You need to sign in to do that
Don't have an account?
SaraHasNoLimits
Error trying to run SOQL relationship query with external objects
I am getting the following error when I try to run a SOQL relationship query involving external objects: UNKNOWN ERROR: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1553848083-42327 (-438141556). I get this same error using the Force.com IDE, Workbench or Developer Console.
Are releationship queries not allowed for external objects? The docs said that up to 4 joins are allowed.
My query looks like this:
Select s.sarahasnolimits__LastName__c, s.sarahasnolimits__FirstName__c, (Select sarahasnolimits__InvDate__c, sarahasnolimits__Status__c, sarahasnolimits__TotalPrice__c From sarahasnolimits__Invoices__r) From sarahasnolimits__Customers__x s
Are releationship queries not allowed for external objects? The docs said that up to 4 joins are allowed.
My query looks like this:
Select s.sarahasnolimits__LastName__c, s.sarahasnolimits__FirstName__c, (Select sarahasnolimits__InvDate__c, sarahasnolimits__Status__c, sarahasnolimits__TotalPrice__c From sarahasnolimits__Invoices__r) From sarahasnolimits__Customers__x s
Can you please make sure there is lookup relationship between sarahasnolimits__Invoices__c(child) and sarahasnolimits__Customers__x(parent) objects?
I have created an external lookup between Invoices (child) and Customers (parent). That was necessary or else I would have not even been able to execute the query.
I do NOT think it is an issue with external objects, but perhaps with relationships AND external objects. Thanks for the suggestions.
I also tried it with anonymous code in Dev Console and trying to run the query to return a list and the request seems to be timing out. No error is returned in that case.
Finally, if I click the Use Tooling API checkbox in Dev Console before I run the query, I get an error saying sobject type is not supported, which tells me that possibly this is just not a supported functionality yet since external objects are so new. But I wanted to confirm that because I am writing an article for DeveloperForce about Lightning Connect and did not want to state that something was not supported if there was another explanation.
An internal error occurred during: "Execute-Anonymous".
java.lang.NullPointerException
List<sarahasnolimits__Customers__x> customers = [Select s.sarahasnolimits__LastName__c, s.sarahasnolimits__FirstName__c, (Select sarahasnolimits__CustId__c, sarahasnolimits__InvDate__c, sarahasnolimits__Status__c, sarahasnolimits__TotalPrice__c From sarahasnolimits__Invoices__r) From sarahasnolimits__Customers__x s];
System.debug(customers);