Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Mike Devenney
    "Too many objects requested" fault returned for...Answered
    Topic posted April 26, 2012 by Mike DevenneyRed Ribbon: 250+ Points, last edited April 26, 2012 
    505 Views, 8 Comments
    Title:
    "Too many objects requested" fault returned for simple object query
    Content:

    Hi all, 

    I'm having trouble getting into querying objects.  I started with a slightly modified version of the WebServicesSamples code for the BasicQueryObjects.  Working in Visual Studio 2010 (code included below).

    I changed the Namespace and TypeName to match my needs and updated the ROQL select statement to this:  "SELECT Description, PFDid, Qty FROM CO.OrderDetails;"  Can anyone tell me why this would return a fault of "Too many objects requested?"

    edit:  I updated my select statement to read: 
    String queryString = "SELECT CO.OrderDetails FROM CO.OrderDetails WHERE CO.OrderDetails.RNOrderID = 487310;";

    This changes my error message to: Non-existant column: 'RNOrderID'

    Thanks, 
    Mike D

    Version:
    November 2011
    Code Snippet:

    Best Comment

    Allan Schrum

    The "too many objects" error is because, for a QueryObjects request, you are asking for too many objects. You are only allowed to ask for one object type at a time. However, your query resembles a good query for using QueryCSV which would return the tabular data that you are requesting. I suspect that you really want to use QueryCSV and not QueryObjects in this situation.

    Regards,

    -Allan

    Comment

     

    • Allan Schrum

      The "too many objects" error is because, for a QueryObjects request, you are asking for too many objects. You are only allowed to ask for one object type at a time. However, your query resembles a good query for using QueryCSV which would return the tabular data that you are requesting. I suspect that you really want to use QueryCSV and not QueryObjects in this situation.

      Regards,

      -Allan

    • Mike Devenney

      Ahhh, missed that subtle point, thanks Allan!  Would it be as simple as changing my service call to the QueryCSV method then?

    • Allan Schrum

      Yes, for the passed parameters are the same, I believe. However, the returned object is different so you'll need to code to handle the different return.

      The returned object assumes you have passed multiple statments to get multiple result sets each containing multiple rows. If you only have a single query then the outer-most object will only contain a single result set (which is normal but confusing to those that did not realize multiple statements can be in a single request). Each statement would be separated by a semi-colon.

      Regards,

      -Allan

    • Mike Devenney

      Great, I'll give that a go, thanks again Allan!

    • Mike Devenney

      Allan,

      Not wanting to return all 300K records in my OrderDetails table I added a WHERE clause.  I changed the call to the QueryCSV method and used this select statement: "SELECT Description, PFDid, Qty FROM CO.OrderDetails WHERE RNOrderID = 487310;".  I'm getting an error that says: Unknown table or column 'RNOrderID'.  

      Can you tell me what I'm doing wrong there?  

      What is the best starting point for someone just getting into ROQL?  I'm writing a workspace add-in with a listbox that I will populate with the results of this call and having a good reference to dig into may answer some of my questions before I post them here...

      Thanks!
      Mike 

    • Mike Devenney

      *forehead slap*

       

      I had my webservice reference pointed to our test environment where the RNOrderID field doesn't exist yet.  We're still in development and haven't pushed the finalized data structure to our test environment.  After reconfiguring the service reference, I got the expected result set back. Thanks again for your help!

       

      Mike D

    • Allan Schrum

      At first glance, your query appears correct. Are you sure that your custom object is deployed and properly setup? What is the definition of the RNOrderID column?

      I am hampered by not knowing more details about your custom object, but the query looks syntactically correct. Please check spelling (case does not matter) of your columns to make sure they are part of "CO.OrderDetails", etc. ROQL is indicating that CO.OrderDetails does not have a simple column called RNOrderID.

      Regards,

      -Allan

    • Allan Schrum

      Glad you found the problem. I'm also glad to see that ROQL was correct: it wasn't there! Let us know how your development progresses. Feedback is always welcome and helpful.

      Regards,

      -Allan