Getting Child Relationship Names using Apex

Apex Aug 4, 2015

For any object if you want to know child relationships associated to it?
Check following snippet

Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
for(Schema.ChildRelationship cr: R.getChildRelationships()){
    system.debug('Relationship Name =>'+cr.getRelationshipName());
}

NOTE: Please replace Account in first line with sObject which you want to get child relationship names

Phanindra Mangipudi

Salesforce, Lightning Web Componets, Node.Js, Angular 2+, Bootstrap