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
Sarah RobertsonSarah Robertson 

Copying a field from a Price book to an oportunity product

Hi

I've created a new custom picklist field in the price book called product family. The users wanted it so when they create a new opportunity product it copies this field from the price book, they also want the field to be a pick list in the opportunity product. I've looked at field updates using workflow but it doesn' allow me to do it. Anyone ever experienced this before ? help ! :)
 
NagaNaga (Salesforce Developers) 
Hi Sarah,

Below is a similar scenario


The Workflow Rule Field update has to be on the Opportunity Product object so you can set a Currency field that can be used in the Rollup field you will create on the Opportunity object.

Let's work it backwards.

1) Create a Buy Price Currency field on the Opportunity Product
2) Create an Opportunity Rollup Summary field that SUMs the OppProduct Buy Price.

Now that's in place, we just need to make sure the OppProduct BuyPrice has the correct value.

1) Create a BuyPriceCalc custom formula currency field on Opportunity Product.  For its formula, use the Advanced Editor and insert the Buy Price field from the PriceBook > Product for the Opportunity Product record.

2) Create a Workflow Rule on Opportunity Product for 'created and every time its edited'.  Set the rule criteria to 'use a formula' and enter a formula of true

3) Add a Field update to the Workflow Rule that sets the BuyPrice field (from #1 above) to a formula.  Use the Show Formula Editor and insert the BuyPriceCalc field.

4) Make sure to Activate the Workflow Rule.

Now, every time an OppProduct is created or edited, the Buy Price from the related Product will be copied into the OpportuntyProduct Buy Price field (using the Workflow Rule), and then automatically SUM'd onto the Opportunity (in the Rollup Summary field)

Please see the below link for more info

https://success.salesforce.com/answers?id=90630000000iAhWAAU

Best Regards
Naga Kiran