You need to sign in to do that
Don't have an account?
SOQL: To Retrieve Data from two Unrelated Sobjects
Hi ! I have to get data from 2 SObjects which have no relationship.
SObject 1:
SUPPLIERS
SUPPLIER_NUMBER SUPPLIER_NAME STATUS CITY
------------------------------------------------------------------------------------------------------------------
S1 abc 20 MUMBAI
Sobject 2:
Project
Project_Number Project_Name City
______________________________________
J1 SORTER Chennai
J2 Display Nellai
The Query Is : "Get supplier number for suppliers who supply Project J1".
Please give your suggestions.
Thanks..
pretty odd question ... then how you are maintaining that for J1 project who are the suppliers
So you would have in layer order:
1. Project
2. Project Supplier
3. Supplier
The project supplier is simply a link between the project and supplier.
You can then run a query on the project supplier object to bring together the two objects:
SELECT Id, Project__r.Name, Supplier__r.Name FROM ProjectSupplier__c WHERE Project__c=:PROJECT_ID