Saleforce Retrieving Fields From Two Different Objects - (soql) Simple Salesforce Python
I am using simpleSalesforce library for python to query SalesForce. I am looking at two different object in SalesForce: Account and Backend (parent-child). The Id in account matche
Solution 1:
Read up about relationships
- https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm
- https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_and_custom_objects.htm
Most likely your query has to be something like
SELECT AccEmail__c,
(select custid__c from Backends__r)
from Account
where Id in (select account__c from Backend__c where custid__c LIKE'%CUST%')
or even
SELECT AccEmail__c,
(select custid__c from Backends__r where custid__c LIKE'%CUST%')
from Account
where Id in (select account__c from Backend__c where custid__c LIKE'%CUST%')
Or if you want it flat
SELECT CustId__c, Account__r.AccEmail__c
FROM Backend__c
WHERE CustId__c LIKE'%CUST%'
Post a Comment for "Saleforce Retrieving Fields From Two Different Objects - (soql) Simple Salesforce Python"