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
MarniMarni 

Validation Rule - Check if Text Field Contains a Specific Set of Characters

I am trying to write a validation rule that says:

If Submitted_for_Approval__c is checked and the text field Name__c does not contain the characters 'TBD' then show the error.  Name__c can contain other characters but it it does not speficially have 'TBD' as part of those characters I want to show the error.

 

I am able to create a working validation rule that says the opposite:

If Submitted_for_Approval__c is checked and the text field Name__c contains the characters 'TBD' then show the error.

by using:

AND(Submitted_for_Approval = true, CONTAINS(Name, 'TBD'))

 

Is there an Operator for 'DOES NOT CONTAIN' or someway to express that?

 

Any help is greatly appreciated, thanks!!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
matermortsmatermorts

Try this:

 

AND(Submitted_for_Approval = true, NOT(CONTAINS(Name, 'TBD')))

All Answers

matermortsmatermorts

Try this:

 

AND(Submitted_for_Approval = true, NOT(CONTAINS(Name, 'TBD')))

This was selected as the best answer
MarniMarni

That worked, thanks!!