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 on updated validation rule

I have this validation rule below for when a user selects Under Contract from the Report Status Category picklist, user must make a selection from the "Contract Includes WC" picklist before saving the record, if not, user will receive an error to make a selection.  

 

AND( ISPICKVAL(Report_Status_Category__c, "Under contract" ),
ISPICKVAL(Contract_Includes_WC__c, ""))

However, I need an updated validation rule that will do the following using some of what was used previously.

 

The "Contract Includes WC" picklist is only available when the following criteria are met:

- "Report Status Category" picklist = "Under contract"

AND

- "WC Target" (checbox), is slected True

 

When these two criterias are met, user must make a selection from the "Contract Includes WC" picklist.

 

Any ideas?

 

Thanks!

 

API Names:

Picklist: Report Status Category = Report_Status_Category__c

Picklist: Contract Includes WC = Contract_Includes_WC__c

Checkbox: WC Target = WC_Target__c

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

It's your lucky day, I'm having a 2-for-1 Sale...

 

AND(
ISPICKVAL(Report_Status_Category__c, "Under contract"),
WC_Target__c,
ISBLANK(TEXT(Contract_Includes_WC__c)))

 

and this one closes the loophole

AND(
OR(
TEXT(Report_Status_Category__c) <> "Under contract",
NOT(WC_Target__c)),
TEXT(Contract_Includes_WC__c) <> NULL)

 

All Answers

Steve :-/Steve :-/

Are you trying to amend the existing rule or create a new one from scratch?

nickfs92840nickfs92840

A new one is fine with me if that is the case Stevemo....

Steve :-/Steve :-/

It's your lucky day, I'm having a 2-for-1 Sale...

 

AND(
ISPICKVAL(Report_Status_Category__c, "Under contract"),
WC_Target__c,
ISBLANK(TEXT(Contract_Includes_WC__c)))

 

and this one closes the loophole

AND(
OR(
TEXT(Report_Status_Category__c) <> "Under contract",
NOT(WC_Target__c)),
TEXT(Contract_Includes_WC__c) <> NULL)

 

This was selected as the best answer
nickfs92840nickfs92840

Once again, you have pulled through! Thanks Stevemo!!!

nickfs92840nickfs92840
AND( ISPICKVAL(Report_Status_Category__c, "Under contract"), ACL_MPI__c, ISBLANK(TEXT(Contract_Includes_WC__c)))

 Stevemo, maybe you can help me on modifying this one you did for me a while back.

 

I need to add another string to this validation rule. 

 

Need this modified to when another checkbox is selected, the rule must be required when one or the other checkbox is selected. So, if either "ACL_MPI__c" or "ACL_DDD__c", are checked, "Contract_Includes_WC__c", must be required.

 

Let me know sir!

Steve :-/Steve :-/

you mean like this?

 

AND(
ISPICKVAL(Report_Status_Category__c, "Under contract"), 
OR(
ACL_MPI__c,
ACL_DDD__c) 
ISBLANK(TEXT(Contract_Includes_WC__c)))

 

nickfs92840nickfs92840

yeah that's it!!!! thanks!!!!!

Steve :-/Steve :-/

No problem, you owe me a beer (and I drink these!)  -> http://beeradvocate.com/beer/profile/863/7971