// creates the input and output message objects
// Create object to hold Query information.
crmondemand.ws.serviceRequest.ServiceRequestWS_ServiceRequestQueryPage_Input serviceRequestlist = new crmondemand.ws.serviceRequest.ServiceRequestWS_ServiceRequestQueryPage_Input();
// Create array of objects to hold records.
crmondemand.ws.serviceRequest.ServiceRequestWS_ServiceRequestQueryPage_Output srOutlist = new crmondemand.ws.serviceRequest.ServiceRequestWS_ServiceRequestQueryPage_Output();
// Create array to hold single Query.
crmondemand.xml.serviceRequest.ServiceRequest serviceRequests = new crmondemand.xml.serviceRequest.ServiceRequest;
// Create object to hold single record, which defines the Query.
crmondemand.xml.serviceRequest.ServiceRequest serviceRequest1 = new crmondemand.xml.serviceRequest.ServiceRequest();
// return these fields in the output message
// Put single Query in Querylist (that can hold only 1 query).
serviceRequests = serviceRequest1;
serviceRequestlist.setListOfServiceRequest(serviceRequests); // Put list of Queries in QueryPage_Input
serviceRequestlist.setPageSize(Integer.toString(PAGESIZE)); // Set the 'n' number of serviceRequests you want to get. Max. is 100.
serviceRequestlist.setStartRowNum(Integer.toString(startRowNumber)); // starting at row 0
// invoke serviceRequestQueryPage using the serviceRequestlist input message
srOutlist = stub.serviceRequestQueryPage(serviceRequestlist);
the UseChildAnd is used to add to the query criteria attributes from the child records.
For all Oracle CRM On Demand object methods (except Attachment), it is possible to query using one
operation within a parent-child relationship. This type of query is called Query By Children. The query
can be assembled using parent attributes as well as child attributes. You can query for all children
of a particular parent or set of parents, all parents of a particular child or set of children, or for both
parents and children of a particular set.
NOTE: When performing a query using Query By Children, certain fields on a child object might not
Not all child objects are filterable in Web Services v1.0 (for example, the Partner child of
CAUTION: This type of query performs slowly and must only be used when necessary.
As an example of how you can search for parent records using criteria on a child:
This query would return all contacts where the first name is John and at least one of John’s addresses
is for Canada. The child criteria are appended to the parent using an AND or OR operator based on
the value of the argument UseChildAnd. When UseChildAnd is true, the child criteria are “ANDed”,
otherwise they are “ORed”.