You need to sign in to do that
Don't have an account?

How to find an object without parent object in apex ?
Hello,
I am actually writing a code that helps to get automatically the dependencies between Object.
While writing my code, I faced an issue. I cannot find a way to know when an object doesn't have a parent object.
How can I find that in apex ?
I am actually writing a code that helps to get automatically the dependencies between Object.
While writing my code, I faced an issue. I cannot find a way to know when an object doesn't have a parent object.
How can I find that in apex ?
If you want to check if a particular object has any parent object whether it's lookup type or master-detail. It'll help.
All Answers
Are you trying to check if the 2 given objects have any relationship between them? If so, you have to get the child relationships of both the objects (using schema methods) and check if the other one is present in the child relationships of one.
-Harsha
If you want to check if a particular object has any parent object whether it's lookup type or master-detail. It'll help.