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
Nicholle MinchNicholle Minch 

Product Summary Field on the Account

My goal is to provide a field on the Account that lists all the products that have been sold from the various Opportunities.  I am looking for the best solution to achieve the goal.
BharathimohanBharathimohan
Hi Nicholle,

There is no direct or standard solution for this.

Suggested Approach:
1. Create a long text area field on Account object
2. Create a after insert trigger on Opportunity Line Item object
3. If this need to work based on opportunity stage, then the trigger has to be created on opportunity (after update)
4. The trigger has to populate the long text area field as comma separated or with new line feed consolidating all the line items of all the opportunities

You need to handle other criteria like what happens if product name changes, what happens if a line is deleted or if a opportunity is deleted etc.,
Hence the trigger needs to do the same function when all these events occur. "get all the product names from all line items from all opportunities of that account and populate on account".

Regards,
Bharathimohan Ramaurthy
Salesforce For All (http://salesforceforall.blogspot.com/)