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
Rehan DawtRehan Dawt 

How to determine related child records from related List on detail page

 

Hello,
Can any one suggest me what i have to do to determine the related child record from related list on detail page apart from describe calls.
I am not able to collect records of child who are related to a particular object.
If any solution is there please let me know...
Warm Regards
Thanks in advance

 

Shashikant SharmaShashikant Sharma

Even though i could not understand your problem but I think inner query can help you. Please elaboate your issue a little more with example.

Rehan DawtRehan Dawt

Hey Hi,

 

For example i have Standard Object Account  and i want to access the Conatct , Opportunity , and other Related Object , from the Account who they are related.

For single Account who all are contacts that are related with.

hey thanks for replying Shashikant

 

 

Shashikant SharmaShashikant Sharma

Use inner query

ID accountid = '001kasak0000IKJ'; // your account id

List<Account> acc = [Select id , ( Select id , name From Contacts) where id =: accountid];

 

acc.Contacts will give you all contacts with this account record , Contacts is relationship name, similar can be used for other related objects

Rehan DawtRehan Dawt

Hey thanks,

 

Can how can i get the related objects like Contacts from generic one...

is there any function from which i can get ..

i don't want to hard code the Contact Object in it...

 

Please...