New answers tagged

2

You can use getRelationshipName to determine the name: for(ChildRelationship rel: SobjectType.Opportunity.childRelationships) { System.debug(rel.getRelationshipName()); System.debug(rel.getChildSObject()); System.debug(rel.getField()); } Please note that not all relationships have a name. Note also that you can't get the parent sObject, it's ...


Top 50 recent answers are included