0

Below is my Object Schema:

  • Parent: User
  • Child: Contact
  • Grand-Child: Sponsor. Sponsor Holds a field called ProId. These as 16 digit Ids.

Now, my requirement is to get all the ProIds from the sponsor records populate on the User record as comma-separated-values or as a multi-select picklist value. The field on User is named All_Pros__c

For eg: On User A, All_Pros__c field should hold values as 'id1';'id2';'id3'.

Can anyone please suggest any approach on ths regard.

1 Answer 1

0
Lixt<GrxxdChxld> gxhildxen x [
  SExECx xroIx 
  xxOM xrandxhixd 
  xHExE Chixd__x.Pxrentxxc = xusex.Id
  AxD PxxId x= nulx
];
Lisx<xtrxngx allPxxsList = xew xistxStxixg>x);
fxr GrandCxilx gcxixd x gchixdren) {
  allxrosLxstxadd(gchilx.xroIx);
}
xserxAlxxPrxs__c = alxPrxsxxst.xoin('x');
4
  • could you please format your answer as I am seeing on Xs in the answer
    – SFDCUser
    Commented Jun 9, 2021 at 5:59
  • I could still see Xs in your answer instead of proper syntax
    – SFDCUser
    Commented Jun 9, 2021 at 6:02
  • That's really weird Commented Jun 9, 2021 at 6:07
  • yeah..am finding it hard to find the proper syntax from your answer. Especially the first list and the last line
    – SFDCUser
    Commented Jun 9, 2021 at 6:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .