You need to sign in to do that
Don't have an account?
JamesHaworthOncam
SOQL subquery not working - even when using Child Relationship Name
Hi,
I'm trying to build a query that has a subquery:
PBSI__Quantity_Needed__c, Id FROM Sales_Order_Lines__r), PBSI__Customer__c
^
ERROR at Row:1:Column:458
Didn't understand relationship 'Sales_Order_Lines__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
See below Child Relationship Name from the master-detail field:
I'm trying to build a query that has a subquery:
SELECT Entity_to_Pack__c, Name, PBSI__Customer__r.Name, PBSI__Contact__r.Name, PBSI__Mode_of_Delivery__c, PBSI__Contact__r.Phone, PBSI__Contact__r.Email, (SELECT PBSI__Estimated_Ship_Date__c, PBSI__Item__r.Name, PBSI__Quantity_Needed__c, Id FROM Sales_Order_Lines__r), PBSI__Customer__c FROM PBSI__PBSI_Sales_Order__c WHERE Id = 'a151r00000EaSFm'For some reason, even though I am using the Child Relationship Name from the master-detail, I'm still getting the following error:
PBSI__Quantity_Needed__c, Id FROM Sales_Order_Lines__r), PBSI__Customer__c
^
ERROR at Row:1:Column:458
Didn't understand relationship 'Sales_Order_Lines__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
See below Child Relationship Name from the master-detail field:
Amnon Kruvi
It looks like this is a managed object, so I'm assuming this relationship is also a managed field. Could you try adding PBSI__ before Sales_Order_Lines__r?