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
Laura BrewerLaura Brewer 

Validation Help

I'm trying to write a validation rule to enforce a selection in the "Industry Sub-Type" field once a particular "Industry" selection is made.  But the Validation I've written isn't yielding the proper result.  Can anyone help with my rule?

AND( ISPICKVAL(Industry, "Inland, Offshore"), ISPICKVAL( Industry_Sub_Type__c , "") )
Is Industry_Sub_Type__c of type multiselect picklist? If so, then use INCLUDES instead.

ISPICKVAL(Industry, "Inland, Offshore") && IF(INCLUDES( Industry_Sub_Type__c , ""),true,false)
Hi Laura,
There is similar thread here -

You can achieve this by making the Industry_Sub_Type__c field dependable on Industry field, then make the Industry and Industry_Sub_Type__c field mandatory in the page layout. This will work if the user must select Industry value. If you dont want to enforce that, then follow the below approach:
I am assuming that Inland and Offshore are 2 different values of Industry picklist. If yes, change your validation rule to:
 OR( ISPICKVAL(Industry, 'Inland'), ISPICKVAL(Industry, 'Offshore') ),
 ISPICKVAL( Industry_Sub_Type__c , '')

Let me know what works for you.

Hi goabhigo,

By making field dependancy we can only restrict the user from front end to select only permissible values, but from backend still user can populate the random picklist value. So, best solution is to use the validation rule which can restict the user from both front end and backend.