Skip to content Skip to sidebar Skip to footer

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

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"