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
cldavecldave 

Validation Rule Admin Exception

Hi i have this VR that works already but when i tried adding an exception for admin i keep getting errors

 

WORKING VR:

AND(
ISCHANGED(Established_1st_Contact__c
),
NOT(ISBLANK(PRIORVALUE(Established_1st_Contact__c
))))

 

I WANT TO ADD TO IT:

 

NOT($Profile.Name = "System Administrator"))

 

Or anything else that would work

 

Thx in advance

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Try this

 

AND(
NOT($Profile.Name = "System Administrator"), 
ISCHANGED(Established_1st_Contact__c), 
NOT(
ISBLANK(
PRIORVALUE(Established_1st_Contact__c)))))

 

 

All Answers

Steve :-/Steve :-/

Try this

 

AND(
NOT($Profile.Name = "System Administrator"), 
ISCHANGED(Established_1st_Contact__c), 
NOT(
ISBLANK(
PRIORVALUE(Established_1st_Contact__c)))))

 

 

This was selected as the best answer
cldavecldave

Thx a lot Steve  it's working like usual

 

Just one thing in case somebody else has same issue in future, there is an extra bracket at the end

 

AND(
NOT($Profile.Name = "System Administrator"),
ISCHANGED(Established_1st_Contact__c),
NOT(
ISBLANK(
PRIORVALUE(Established_1st_Contact__c))))

Steve :-/Steve :-/

yeah, bad copy&paste on my part

Dipika RajputDipika Rajput

I also want to fire my validation rule for all profiles except System admin 

AND( 
NOT($Profile.Name = "System Administrator"), 
Customer_Flag__c, 
IF(ISPICKVAL( Call_Outcome__c, 'Left Message with Third Party') 
||ISPICKVAL( Call_Outcome__c, 'Payment extension under Review') 
||ISPICKVAL(Call_Outcome__c, 'Call Back') 
||ISPICKVAL( Call_Outcome__c, 'Promise to Pay') 
||ISPICKVAL( Call_Outcome__c, 'Paid partially'), 
ISNULL( Call_Back_Date__c), false) 
)

but its not working please correct me if am doing something wrong.