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
Terry_0101Terry_0101 

How to make these profiles exempt from this Validation Rule?

How to make these profiles exempt from this Validation Rule?  I tried this but it does not work:   
&& (NOT($User.ProfileId="005A00000015yWV")) 

AND( 
Amount__c > 1, 
ISBLANK(TEXT( type__c )), 
NOT(ISNEW()), 
NOT(OR( 
$Profile.Id<>"00e40000000oRAA", 
$Profile.Id<>"00e4000000132AW", 
)) 
Hargobind_SinghHargobind_Singh
Try the following: 
  • Instead of using "<>", try using "=". So that if any profile ID matches, your OR would return TRUE, and NOT would convert it to FALSE, and our overall AND would result FALSE, so validation rule won't show any error. 
  • also try using 18 character Profile IDs 

=====
ps: If your question/problem is resolved/answered, please mark your post as 'Solved' so that community can benefit by resolved posts. 
JayantJayant
In && (NOT($User.ProfileId="005A00000015yWV")), "005A00000015yWV" is an Id of User record, please pull the user's Profile Id and use that.


AND( 
Amount__c > 1, 
ISBLANK(TEXT( type__c )), 
NOT(ISNEW()), 
NOT(OR( 
$Profile.Id<>"00e40000000oRAA", 
$Profile.Id<>"00e4000000132AW", 
)) 

If above is correctly setup (though it seems fishy as ANDing Amount__c and Type does not make much sense, because it won't catch an empty Type if Amount is greater than 1), modify it as - 

AND( 
Amount__c > 1, 
ISBLANK(TEXT( type__c )), 
NOT(ISNEW()), 
AND( 
$Profile.Id<>"00e40000000oRAA", 
$Profile.Id<>"00e4000000132AW", 
)


Now the profiles - 00e40000000oRAA and 00e4000000132AW are exempted to update (not create) the record when Type is blank and Amount is greater than 1. To exempt a new profile simply add it to the comma separated list of Profile Ids like - 

AND( 
$Profile.Id<>"00e40000000oRAA", 
$Profile.Id<>"00e4000000132AW", 
$Profile.Id<>"00exxxxxxxxxxxx"
)