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
Temisha PoeTemisha Poe 

Code needed for trigger when sales price changes

Our Sales Price = List Price but users can edit the Sales Price.
I need to trigger an email notification to the Opportuntiy Owner's manager when the sales price is changed (or doesn't equal the List Price).
Each user profile has a manager and each sales user has a default opportunity team with his/her manager identified as "Sales Manager".
Issue: standard SF functionality will not allow a trigger on the List Price or Sales Price.
Exhausted all options and confirmed with SFDC support this trigger will require custom code.
Any suggestions?
Iman MaghrooriIman Maghroori
This is a great question! But I'm worried you may be doing this the hard way...

Why not create a validation rule that prevents the users from saving an "Opportunity Product" record, where the List Price != Sales Price? 
Then, you're users can't set the wrong value. 

Just tested it in my own org. :)
Temisha PoeTemisha Poe
I can remove the permission from the profile to prevent them from changing the Sales Price. The challenges we are facing with that is when we need to prorate an item or add a sales price for custom quotes, etc. For the most part, the price doesn't or shouldn't change but when it does, we need to alert their manager as an addiitional check point. The managers current review quotes through the approval process but with over 1500 products, they can't catch them all.
If I can write the validation rule to restrict changing the sales price for specific product families, that may give me a place to start. I was told by SFDC Support, i can't trigger on List or Sales Price.