0

I am given some requirements to create custom fields to make a copy of the data sources on the opportunity object on Salesforce.

Here is the full user story: Sales Reps choose a variety of products via the product related list on the Opportunity object. We would like to create a copy of what data sources they choose to live on the opportunity so that we can export to another application. How would you go about creating fields on the Opportunity page that consist of the data source names (Product name) and List Prices (product.list prices) that the sales rep has chosen?

My original thought is to create a formula field and lookup to OpportunityProducts.[Product Name] or the OpportunityProducts.[Price List]. However, this cannot be done because OpportunityProducts is a junction object and we can't reference cross objects.

Given that an opportunity can have many products, would the custom field have to be a multipicklist field/text area field? How would we make the price lists accoridngly to the product selected? Here are some Product & List Price Examples:

Product Name List Prices
Product 1 $1,000
Product 2 $2,000
Product 3 $3,000
Product 4 $4,000

The ask, I found is somewhat similar to this post.

1
  • this can be done with DLRS but I agree with @sfdcfox that rolling up details into a long text field as JSON is not desirable use of the schema
    – cropredy
    Commented Jan 2, 2021 at 20:14

1 Answer 1

1

Rollup Summary fields are best used to get things like total quantity, average cost, and the like. They can't summarize data this way, so the alternative would be a trigger. However, it's far more efficient to simply have the external system perform a sub-query and get the information directly. This is almost always less development effort than to bundle the data in Salesforce just to have it reparsed in the external application.

2
  • I completely agree with you. In my head, when I saw the requirement, I am like, why don't they just create a custom report and call it a day (or your suggestion of having the external system perform a subquery and get the information directly)? It's way too complicated to go through all the work just so that the data is in one object. Rollup Summary is a good idea but unfortuantely, it seems like they want product name + list prices. It looks like the alternative is to create a trigger on OpportunityProduct. Commented Jan 3, 2021 at 0:25
  • @sfdcfox I have a similar requirement, but to just display the Product Name on the Opportunity based on the product at the line item. To be displayed on a multi select picklist. Is this possible with a flow? Or would it need a trigger? Thanks!
    – Priya
    Commented Mar 13, 2021 at 18:47

You must log in to answer this question.

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