How can Opportunity Products be prevented from being edited or modified using Validation Rules once the Opportunity Stage is marked as Closed?
Note: This solution involves creating a Roll-Up Summary Field and two Validation Rules (one on Opportunity and one on Opportunity Product).
Business Case:
A Sales Manager wants to block any changes to Opportunity Line Items for all Closed Opportunities. By adding one Roll-Up Summary Field and two Validation Rules, the Sales Manager can enforce this business policy.
To prevent create & edit to Opportunity Line Items on Closed Opportunities
Create a Validation Rule on Opportunity Product
To prevent deletes to Opportunity Line Items on Closed Opportunities
Create a Validation Rule on Opportunity
Assumes that you have a custom Roll-Up Summary Field on Opportunity object called Number of Line Items, that Counts the number of Opportunity Product records associated to an Opportunity.
1. Description: Prevents users from deleting opportunity products after an opportunity is closed. Create the following validation rule example on opportunities. It uses a custom roll-up summary field on opportunities that counts the number of opportunity products on an opportunity
2. Formula: AND(OR(ISPICKVAL(StageName, "Closed Won"),
ISPICKVAL(StageName, "Closed Lost")),
Number_of_Line_Items__c <
PRIORVALUE(Number_of_Line_Items__c) )
3. Error Message: Opportunity Line Items cannot be deleted because the Opportunity is closed.
4. Error Location: Top of Page
For Additional Validation Rule Samples search the Help & Training for
000385411

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.