Activity Forums Salesforce® Discussions How to retrieve data from multiple Objects in one query ?

  • MOHIT

    Member
    May 20, 2020 at 3:22 pm

    SELECT (SELECT Obj1__r.Name FROM Junction1__r),
    (SELECT Obj3__r.Name FROM Junction2__r),
    Name
    FROM Obj2__c
    WHERE Id IN (SELECT Obj2__c FROM Junction1__c WHERE Obj1__c = 'some-id-here')

  • Pooja

    Member
    May 20, 2020 at 3:56 pm

    SELECT (SELECT Obj1__r.Name FROM Junction1__r),
    (SELECT Obj3__r.Name FROM Junction2__r),
    Name
    FROM Obj2__c

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos