on-internet
← Community

How to form SOQL query for multiple objects in salesforce

Stack Overflow ·

There are 5 objects: contact, account, account_contact__c, user, recordtype in Salesforce. Below is the SQL query which needs to be converted to Salesforce SOQL query SELECT c.id,c.fname,c.lname,u.name, ac.desc, r.date FROM contact c LEFT JOIN user u on c.oid =u.sfid LEFT JOIN account_contact__c ac on c.sfid=ac.contact_id__c LEFT JOIN account a on a.sfid=ac.account_id__c LEFT JOIN recordtype r on a.recordtypeid =r.sfid and r.type=‘test’ I managed to join 2 objects but in the second table, I’m not able to add more than one field. Select id,fname,lname from contact where id in ( select contact_i

Comments

Sign in or sign up to comment and upvote.

No comments yet.