如题,使用Apex代码实现:
Schema.DescribeSObjectResult describeResult = YourObjectName__c.sObjectType.getDescribe();
List<Schema.ChildRelationship> childRelationships = describeResult.getChildRelationships();
for(Schema.ChildRelationship childRel : childRelationships) {
if(childRel.getField().getDescribe().isNamePointing() == false) {
Schema.DescribeSObjectResult childDescribe = childRel.getChildSObject().getDescribe();
String childObjectLabel = childDescribe.getLabel();
String fieldLabel = childRel.getField().getDescribe().getLabel();
System.debug('@@@@@Child Object Label: ' + childObjectLabel + ', API Name: ' + childRel.getChildSObject() + ', Field API Name: ' + childRel.getField().getDescribe().getName() + ', Field Label: ' + fieldLabel);
}
}
YourObjectName__c换成你的对象名,之后在Developer Console的匿名块中执行即可,结果会出现在Log里。