You need to sign in to do that
Don't have an account?
Vashnar
Lock Oppty based on one of two picklist values, except Admins
Trying to lock editing on Opptys if they have one of two picklist values selected. Also need to except Admins from the rule.
My current attempt:
AND(
ISPICKVAL(Status__c,"Active"),
ISPICKVAL(Status__c,"Expired"),
NOT($Profile.Id = "00e80000000zMnI")
)
Thanks in advance!
Brian
try this validation rule:-
AND( OR(
ISPICKVAL(Status__c,"Active"),
ISPICKVAL(Status__c,"Expired")),
NOT($Profile.Id = "00e80000000zMnI")
)
All Answers
try this validation rule:-
AND( OR(
ISPICKVAL(Status__c,"Active"),
ISPICKVAL(Status__c,"Expired")),
NOT($Profile.Id = "00e80000000zMnI")
)
Think you might want.....
OR(
ISPICKVAL(Status__c,"Active"),
ISPICKVAL(Status__c,"Expired")
) &&
NOT($Profile.Id = "00e80000000zMnI")
Using hard-coded values is a bad practice. Use $Profile.Name instead, as below:
AND( OR(
ISPICKVAL(Status__c,'Active'),
ISPICKVAL(Status__c,'Expired')),
NOT($Profile.Name = 'System Administrator')
)
I thought the Profile ID was better practice as it will not change, but the Profile Name could change and break the validation rule
Thanks!
You cannot change the "System Administrator" profile name.
In a typical business environment, the profile names would be all fixed and never change. The development would actually happen on multiple sandboxes. The components would then be moved to production through changesets. As such, the profile ids would keep changing for each sandbox and production. But the name remains the same.