Topic by Daniel Symms
Content
Perhaps I'm doing something wrong but I am unable to retrieve multiple custom objects types from a single QueryObjects request. I can specify a Contact object along with a single custom object in the ObjectTemplates and this works fine. However, specifying a second, different custom object fails, either returning the same object type for the second select, or resulting in no object found (see error in result xml). Independently, the same queries work fine. An outline of the java code is below.
Here is the body of the xml request:
<soapenv:Body>
<ns7:QueryObjects xmlns:ns7="urn:messages.ws.rightnow.com/v1.1">
<ns7:Query>select EM$Appl$Contact from contact where login = '11173300';select EM$Appl$Contact.EM$Chkl$Appl from Contact where login = '11173300';</ns7:Query>
<ns7:ObjectTemplates xmlns:ns2="urn:generic.ws.rightnow.com/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:GenericObject">
<ns2:ObjectType>
<ns2:Namespace>EM</ns2:Namespace>
<ns2:TypeName>Appl</ns2:TypeName>
</ns2:ObjectType>
</ns7:ObjectTemplates>
<ns7:ObjectTemplates xmlns:ns2="urn:generic.ws.rightnow.com/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:GenericObject">
<ns2:ObjectType>
<ns2:Namespace>EM</ns2:Namespace>
<ns2:TypeName>Chkl</ns2:TypeName>
</ns2:ObjectType>
</ns7:ObjectTemplates>
<ns7:PageSize>10000</ns7:PageSize>
</ns7:QueryObjects>
</soapenv:Body>
The first query result contains the correct Appl object. The second result returns this xml:
<n0:Result>
<n0:RNObjectsResult/>
<n0:Paging>
<n0:ReturnedCount>0</n0:ReturnedCount>
<n0:StartIndex>0</n0:StartIndex>
<n0:QueryHandle/>
</n0:Paging>
<n0:Fault>
<n3:exceptionCode>INVALID_REQUEST</n3:exceptionCode>
<n3:exceptionMessage>Unexpected error processing row 0: Invalid ID: Appl with ID 258495 does not exist
While processing Custom Object Get() of EM|Appl</n3:exceptionMessage>
</n0:Fault>
</n0:Result>
If I reverse the order of the queries and ObjectTemplates, both queries return results, but the second result is also a grandchild object type (Chkl) and not even related to the given Contact.
I thought the problem might be due to the child-grandchild relationship but I experienced very similar results using two custom object queries of unrelated objects, both direct child objects of Contact.
Version
February '13
Code Block