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
nickfs92840nickfs92840 

Help with Validation Rule

Ok have this scenario where: 

 

When Check_box__c is checked, and "Picklist__c" = "Picklistitem1", a selection to "Picklist2__c" is required. 

 

I wrote this validation rule but it is not erroring out for user to select from "Picklist2__c"

 

Here is what my validation rule looks like: 

 

AND( 
ISPICKVAL(Picklist__c, "Picklistitem1"), 
Check_box__c = TRUE, 
ISBLANK(TEXT(Picklist2__c)), NOT( $User.ProfileId <> "00e30000000qvIE") 
)

 Thanks!

 

Best Answer chosen by Admin (Salesforce Developers) 
Starz26Starz26

Then use:

 

AND( 
ISPICKVAL(Picklist__c, "Picklistitem1"), 
Check_box__c = TRUE, 
ISBLANK(TEXT(Picklist2__c)), NOT( $User.ProfileId = "00e30000000qvIE") 
)

All Answers

Starz26Starz26

Works for me without the profile part.

 

Is the profile of the user testing this validation rule = 00e30000000qvIE if not that is your issue

Steve :-/Steve :-/
NOT( $User.ProfileId <> "00e30000000qvIE" 

 Is a double-negative, you're essentially saying "NOT not equal to..."

nickfs92840nickfs92840

I need to block that USER ID profile from this rule though.

Starz26Starz26

Then use:

 

AND( 
ISPICKVAL(Picklist__c, "Picklistitem1"), 
Check_box__c = TRUE, 
ISBLANK(TEXT(Picklist2__c)), NOT( $User.ProfileId = "00e30000000qvIE") 
)
This was selected as the best answer
nickfs92840nickfs92840

Thank you Starz!