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

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) {
xserxAlxxPrxs__c = alxPrxsxxst.xoin('x');
  • could you please format your answer as I am seeing on Xs in the answer
    – SFDCUser
    Jun 9, 2021 at 5:59
  • I could still see Xs in your answer instead of proper syntax
    – SFDCUser
    Jun 9, 2021 at 6:02
  • That's really weird 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
    Jun 9, 2021 at 6:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.