You need to sign in to do that
Don't have an account?

How to Query the child records of parent object on which trigger is running.
How to Query the child records of parent object on which trigger is running and fetch the respective child records of the enitity.
Hi sfdc Beginner,
You can use the below format for standard objects: Which gives you a list of parent objects with their corresponding child objects. You should use the plural of the child object (childobject becomes childobjects).
For custom objects, there is a small change in the query : where childobjects__r is the relationship name of childobject__c custom object and parentobject__c is the name of the custom parent object.
Please let me know if this helped you.
Thanks,
Shyama
All Answers
Hi sfdc Beginner,
You can use the below format for standard objects: Which gives you a list of parent objects with their corresponding child objects. You should use the plural of the child object (childobject becomes childobjects).
For custom objects, there is a small change in the query : where childobjects__r is the relationship name of childobject__c custom object and parentobject__c is the name of the custom parent object.
Please let me know if this helped you.
Thanks,
Shyama