Wednesday, April 12, 2017

To check if the parent have child using SOQL

Use Left Inner Join

SELECT Id FROM Opportunity WHERE Id IN (SELECT Opportunity__c FROM Opportunity_Child__c)

Reference
A Deeper look at SOQL and Relationship Queries on Force.com
SOQL to determine if parent has child records

No comments:

Post a Comment