Fetch child object names

PHOTO EMBED

Sat May 04 2024 13:58:13 GMT+0000 (Coordinated Universal Time)

Saved by @saloni_naik

Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();

for (Schema.ChildRelationship cr: R.getChildRelationships()) {
    if (cr.getRelationshipName() == null) continue;
    system.debug('Child Object Relationship Name:'+cr.getRelationshipName());            
}
content_copyCOPY