I have the following validation rule to prevent users from editing or creating products once the opportunity is won. The issue is that it can still be edited if they click on "edit all" in the opportunity object. Also, I would like to lock the "Quantity" and "Sales Price" once the opportunity is won. How can I do that? The code below prevents everything in the product from being edited after the opportunity has been awarded.

    ISPICKVAL(Opportunity.StageName, "WON"), 
    ISPICKVAL(Opportunity.StageName, "LOST")
  • That VR is in the opportunity object though. would I add it to that same code?
    – user48169
    Sep 19, 2017 at 14:19

1 Answer 1


You would write a validation rule on OpportunityLineItem as follows:

Opportunity.IsClosed && Opportunity.IsWon && (ISCHANGED(UnitPrice) || ISCHANGED(Quantity))

And if needed put a validation rule in Opportunity like this considering Amount is calculated based on lineItems:

Opportunity.IsClosed && Opportunity.IsWon && ISCHANGED(Amount))
  • The first one worked like a charm
    – user48169
    Sep 19, 2017 at 19:46

You must log in to answer this question.