You need to sign in to do that
Don't have an account?
daniel k 4
Identifying all the child objects of a parent object
Hi All,
I have an object(standar/custom) and need to identify all the related objects(lookup) of that object.
Let's say I have Account object and this object might be related as lookup to many other objects, how can I find all those objects ?
Thanks,
D
I have an object(standar/custom) and need to identify all the related objects(lookup) of that object.
Let's say I have Account object and this object might be related as lookup to many other objects, how can I find all those objects ?
Thanks,
D
For getting All Parent objects:
For getting All Child objects:
All Answers
For getting All Parent objects:
For getting All Child objects:
Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
for (Schema.ChildRelationship cr: R.getChildRelationships()) {
if (cr.isRestrictedDelete()) {
system.debug(‘====child object===’+cr.getChildSObject());
}
}
Schema.getGlobalDescribe().get(fObjectName).getDescribe();
(here fObjectName is the name of the object in string)