Skip to main content
Question Protected by CommunityBot
Notice removed Canonical answer required by Lily
Bounty Ended with Robin De Bondt's answer chosen by Lily
Tweeted twitter.com/StackSalesforce/status/742743518398062592
Notice added Canonical answer required by Lily
Bounty Started worth 100 reputation by Lily
Removed user's name, removed unnecessary sentence break
Source Link

I have the following validation rule:

AND( 
$Profile.Name <> 'System Administrator', 
OR( 
ISPICKVAL(PRIORVALUE(Level__c), "Archived"), 
ISPICKVAL(PRIORVALUE(Level__c), "Closed") 
) 
)

This validation rule is on the opportunity object, and basically, what I want to achieve is, if the picklist Level__c is either set to Archived or Closed, the opportunity record can only be edited by the System Administrator.

For some reason though, the validation rule also triggers, when I want to set the Level__c to Archived or Closed. But this is not what I want.

Any idea what's wrong with the validation rule? Tia

I have the following validation rule:

AND( 
$Profile.Name <> 'System Administrator', 
OR( 
ISPICKVAL(PRIORVALUE(Level__c), "Archived"), 
ISPICKVAL(PRIORVALUE(Level__c), "Closed") 
) 
)

This validation rule is on the opportunity object, and basically, what I want to achieve is, if the picklist Level__c is either set to Archived or Closed, the opportunity record can only be edited by the System Administrator.

For some reason though, the validation rule also triggers, when I want to set the Level__c to Archived or Closed. But this is not what I want.

Any idea what's wrong with the validation rule? Tia

I have the following validation rule:

AND( 
$Profile.Name <> 'System Administrator', 
OR( 
ISPICKVAL(PRIORVALUE(Level__c), "Archived"), 
ISPICKVAL(PRIORVALUE(Level__c), "Closed") 
) 
)

This validation rule is on the opportunity object, and what I want to achieve is, if the picklist Level__c is either set to Archived or Closed, the opportunity record can only be edited by the System Administrator.

For some reason though, the validation rule also triggers, when I want to set the Level__c to Archived or Closed. But this is not what I want.

Any idea what's wrong with the validation rule?

Source Link
Lily
  • 1.4k
  • 11
  • 41
  • 76

Validation Rule to prevent editing record

I have the following validation rule:

AND( 
$Profile.Name <> 'System Administrator', 
OR( 
ISPICKVAL(PRIORVALUE(Level__c), "Archived"), 
ISPICKVAL(PRIORVALUE(Level__c), "Closed") 
) 
)

This validation rule is on the opportunity object, and basically, what I want to achieve is, if the picklist Level__c is either set to Archived or Closed, the opportunity record can only be edited by the System Administrator.

For some reason though, the validation rule also triggers, when I want to set the Level__c to Archived or Closed. But this is not what I want.

Any idea what's wrong with the validation rule? Tia