Not allowing certain products to have their price changed

Standard
So this question was asked today on the salesforce.com Answer Community.
I am trying to put together a validation  rule that will only allow two of our product codes to have a manually adjusted sales price.
I responded with a few things but unfortunately didn’t put as much thought into it as I should have. The person was having troubles getting it to work so I decided to dive in deeper and get this one for them. It ended up being much easier than I expected.
So the point of this validation rule is to make it so that only certain products can have their prices changed at the opportunity line item level. Certain products should always be the list price no matter what.
 
My first suggestion was to create a field at the product level to designate products that should have the price changed (you could go the other direction and I will address that below). So create a field named “Manual Sales Price” on the product object. Then go in and check any products you want users to change the price of.
After you do this go to Validation Rules under Opportunity Products.
For the error condition use the below…
AND(
Product2.Manual_Sales_Price__c = False,
PricebookEntry.UnitPrice <> UnitPrice
)
What we are doing is comparing the base unit (list) price with the unit (sales) price the user it typing in.  If the product doesn’t have Manual Sales Price checked then they will receive an error message.
As I stated earlier you can go the other way and only mark the products you want to allow a price override on. Name the field whatever you want and then change the above YOUR_FIELD_NAME = TRUE.
You might want to give certain people the ability to override prices, though. You can add something like the users profileID into the mix. In my example I will allow System Administrators to change the price and all others cannot.
AND(
Product2.Manual_Sales_Price__c = False,
PricebookEntry.UnitPrice <> UnitPrice,
$User.ProfileId <> ‘SYSADMINPROFILEID’
)
Good luck and hope this helps some people.

Leave a Reply

Your email address will not be published. Required fields are marked *