0

I'am trying to get(request) Accounts with some informations from child called Services__c. When im performing query in inspector it works fine

SELECT Legal_Name__c, Name, BillingCountry, (SELECT Service__c, Sub_Service__c FROM Services__r WHERE Service__c = 'Connectivity' AND (Sub_Service__c = 'GSM Signaling' OR Sub_Service__c = 'GSM Signaling Peering')) FROM Account

But when im adding this query to url and sending get request in postman im receiving

"\nService__c, Sub_Service__c FROM Services__r WHERE Service__c = 'Connectivity'\n ^\nERROR at Row:1:Column:85\nDidn't understand relationship 'Services__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.",

2 Answers 2

0

SOQL query appears to be mostly correct, but there is a small issue with the subquery condition. Use IN instead of = when filtering on multiple values for the Sub_Service__c field

Change:

SELECT Legal_Name__c, Name, BillingCountry, (SELECT Service__c, Sub_Service__c FROM Services__r WHERE Service__c = 'Connectivity' AND (Sub_Service__c IN ('GSM Signaling', 'GSM Signaling Peering')) ) FROM Account
1
  • 1
    Didn't help neither, same error :/
    – B.G
    Commented Oct 18, 2023 at 10:35
0

Issue kind of solved. After making REST get call in workbench i discovered that is translated to SELECT+Legal_Name__c,+Name,+BillingCountry,+(SELECT+Service__c,+Sub_Service__c+FROM+Services__r+WHERE+Service__c+=+'Connectivity'+AND+(Sub_Service__c+=+'GSM Signaling'+OR+Sub_Service__c+=+'GSM Signaling Peering'))+FROM+Account Instead of whitespace pluses are added, it's still doesn't work when sending out from postman. But when making this call from different system it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .