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
AMAN SINGH 24AMAN SINGH 24 

hello everyone I am confused about Schema.ChildRelationShip.getchildObject What Child SObject it return?

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

this in not give either contact ,cases or opportunity so what kind of object it is returning?
 thanks in advance
Raj VakatiRaj Vakati
Hi Aman,
You have to do it like this.You can see the system.debug which is printing all the child  objects 


Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
List<Schema.ChildRelationship> C = R.getChildRelationships();
 
for( Schema.ChildRelationship sc :c){
    System.debug('sc'+sc);
}


 
AMAN SINGH 24AMAN SINGH 24
Hello Rajamohan.Vakati,
But i am not able to see the Contact or case
objects why is it so
HARJITHARJIT
Hello @AMAN SINGH 24, Even I'm having the same doubt did you found the solution how to fetch only contact and opportunity of account object