You need to sign in to do that
Don't have an account?
lalitha_sfdc
How can I get the list of values of child 1 from child 2 which are associated to the same parent
I have list of records from child 1 from the below query
I have list of child2
But I Have to update child1 fields in for loop as below accessing from child2 through parent
Child2 has one to one mapping with parent.
child1list=[select name,id,parent__c,field11,field12 from child1__c]
I have list of child2
child2list=[select id,name,parent__r,parent__r.name,field21,field22 from child2 where parent__c in : parentids]
But I Have to update child1 fields in for loop as below accessing from child2 through parent
for(child1__c child1 : child1list){ child1list.field11=child2list[].field21;//how to associate the related record here in child2list[] }
Child2 has one to one mapping with parent.
I met the above requirement using map of (parentTochild2).
Now we can fetch the values as below.
All Answers
What if child1 have 3 records and child2 have 5 records> How do you want to handle this situation?
I met the above requirement using map of (parentTochild2).
Now we can fetch the values as below.
Let me know your thoughts
Regards
Regards