Ask Search:
Megan FuquaMegan Fuqua 

Prevent changes to opportunties after close


I would like to prevent users from changing opportunity products once the opportunity is closed.  I would like to retain the rights to change the opportunity products after closed only for certain users.  I found the following article in knowledge but am not sure how to add the additional criteria of only certain users retaining edit rights after close.

Any help?

To prevent create & edit to Opportunity Line Items on Closed Opportunities


Create a Validation Rule on Opportunity Product

  1. Description: Prevents users from editing opportunity products after an opportunity is closed. Create the following validation rule example on opportunity products.
  2. Formula: OR(ISPICKVAL(Opportunity.StageName, "Closed Won"), ISPICKVAL(Opportunity.StageName, "Closed Lost"))
  3. Error Message: Opportunity Line Items cannot be created or edited because the Opportunity is closed.
  4. Error Location: Top of Page

Steve MolisSteve Molis
Steve MolisSteve Molis
Also, if you want to lock (or do anything) with Open, Closed or Won opportunities you do not have to bother with evaluating all of the Opportunity.Stagename picklist field values.  You can just use the standard SFDC boolean fields.  

IsClosed and IsWon  and use TRUE/FALSE, or NOT(IsClosed), NOT(IsWon), etc...  
Guillermo PedroniGuillermo Pedroni
I did this as a validation rule. 

AND( 
CONTAINS(TEXT(StageName) , "Closed") , 
ISCHANGED(OwnerId) , 
$User.API_Integration__c = FALSE, 
Allow_Owner_Change__c = FALSE 
)

Allow Owner Change is a custom checkbox on the user profile, to give specific people access to make the change (like managers).
API Integration is for a specual integration user that gets access to bypass many validations that fall out of most day to day user scenarios.