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
Priyesh Misquith 12Priyesh Misquith 12 

custom rollup and Concationation of field

Hi ,

I have a scenario where
  • I have a Text field in Opportunity named List Invoce Number's.This field will should populate the vaule from the child Object Opportunity Product Number field "Invoice Number"
  • I want to populate all the Invoice Number field values of child object in a single field List Invoce Number's on Parent Opportunity Object. By Concatinating the values in the field .
  • If there is duplicate Invovice number in the child object then it should add only one value in the List Invoce Number's.  The single Opportunity can contain the duplicate Opportunity Product with similar "Invoice Number".
Please let me know if it is possible to achive through the configuration like formula field ,process builder etc.
Or we need to write the trigger for this scenario)
ShirishaShirisha (Salesforce Developers) 

Hi Priyesh,

Greetings!


Since the Opportunity Object can have multiple products it might be possible by the single formula field.However,this can be acheived by the trigger since you would like to append all the child record's Invoice numbers in one field on Opportunity.

You can create the trigger on Opportunity Object and query the related Products to store the Invoice numbers.If you would like to append them separated by comma(,) then inlcude the (,) as well.

Please find the sample trigger code on Opportunity:

https://developer.salesforce.com/forums/?id=906F0000000Af2XIAS

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri