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
Sarita Pa 3Sarita Pa 3 

RelationShip Query Iteration

Hi All,
Good Day. Could you help me with the below scenario.
I have two object Collaboration Group and Collobration Group Member. 
Relation Ship: 
CollaborationGroup is Parent and Collaboration Group Member is Child
Relationship Name is GroupMembers in Collaboration Group.
Data Set Example

Colloboration Group: 
Cg1, CgName,
Collobaration Group Member:
CGM1, CGName1, CG1(Reference to Parent)
CGM2, CGName2, CG1(Reference to Parent)
When I query in work Bench as below 
Select id,Name, (Select Id from GroupMembers) from ColloborationGroup --> I get Below result
CG1, CgName, CGM1,CGM2(as a table). 

But In the apex code when I try to iterate i am not getting the Member information i am only getting CG1,CgName information. 

Any help will be appreciated how to get the Member information while iterating in APEX



 

VinayVinay (Salesforce Developers) 
Hi Sarita,

You can reachout to accelerate team who can help your implementation request if you have premier support.

https://help.salesforce.com/s/articleView?id=000387492&type=1

Thanks,
Sarita Pa 3Sarita Pa 3
No Sorry this is my personal work what i am doing. Thank you for your quick response