function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mohan sharmaMohan sharma 

How to retrive child or grand child for selected object .?

I have a picklist in visualforce page which contain organization all object including custom and standard as well. When user change any object that time i want to retrive all child and grand chield for selected object and then display in pageBlocktable using rerender.
Best Answer chosen by Mohan sharma
Deepak Kumar ShyoranDeepak Kumar Shyoran
You can retrieve all child object using getChildRelationships() ;

For example :

Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
List<Schema.ChildRelationship> C = R.getChildRelationships();