Another Salesforce blog!!!

Salesforce, Apex

parent and child relationshiop


ChildRelationship

for (ChildRelationship relationship : SObjectType.Parent__c.getChildRelationships())
    if (relationship.getChildSObject() == Comp_Profile__c.sObjectType)
        system.debug(relationship.getRelationshipName()); // you need this in SOQL

Leave a Reply

Your email address will not be published. Required fields are marked *

*