You need to sign in to do that
Don't have an account?
Ek0nomik
Is it possible to query a lookup relationship (API)?
Let's say I have two objects: Product Serial Numbers and Returns.
Product serial numbers are not required to have a return, because, the product may be operating absolutely fine. But, when a return is created, there is a lookup to the product serial number so that the user will know what specific product had the issue so that it can be inspected, taken our of service, etc.
When I am querying a list of product serial numbers, am I able to pull in the optional return records that are associated with it?
In Apex Code, each Product_Serial_Number__c will have a List<Return__c> called Returns__r, which can be checked for emptiness (List.isEmpty()), number of records (List.size()), and can be iterated through like any other List<SObject>.
In {insert your language here}, the constructs may be different, depending on a number of factors, including if you used the Enterprise or Partner WSDL, the IDE and how it designs data consumption, and the language's interface with web services/SOAP.
All Answers
In Apex Code, each Product_Serial_Number__c will have a List<Return__c> called Returns__r, which can be checked for emptiness (List.isEmpty()), number of records (List.size()), and can be iterated through like any other List<SObject>.
In {insert your language here}, the constructs may be different, depending on a number of factors, including if you used the Enterprise or Partner WSDL, the IDE and how it designs data consumption, and the language's interface with web services/SOAP.
Thanks, that did the trick. I'm not sure how I missed that in the documentation.