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
dlcsfadmindlcsfadmin 

Picklist to return null value

Does anyone know how to return a null value validation rule against a picklist? As you can see below, the offer_declined__c field is a picklist datatype. I want to make sure that if the user selects 7c - Candidate Withdrew event type the offer declined field must be blank


AND(
ISPICKVAL( Event_Type__c , "7c - Candidate Withdrew"),
NOT ISNULL(Offer_Declined__C ))
TCAdminTCAdmin

Hello dlcsfadmin,

I think you are looking for ISPICKVAL(Offer_Declined__c, "") which will return true if there is not a value chosen in the picklist. You can utilize the NOT() as you need to beyond that.

dlcsfadmindlcsfadmin
I am having another problem.  I can create a validation rule now to esnure that 1 field is null when a value is selected from another field.  Hpwever, how do i reference 2 fields to be null when a value is selected from another field.  The validation rule below does not work. When I selected "7c - Candidate Withdrew" from the Event_Type__c field, I made Offer_Declined__c and Offer_Not_Extended__c empty but it still wouldn't save the record.



AND(
ISPICKVAL( Event_Type__c , "7c - Candidate Withdrew"),
NOT ISPICKVAL(Offer_Declined__c, ""),
NOT ISPICKVAL( Offer_Not_Extended__c , ""))
TCAdminTCAdmin
dlcsfadmin,

This should do what you want. If either of the picklists have values you want it to error out.
AND(
    ISPICKVAL( Event_Type__c , "7c - Candidate Withdrew"),
    OR(
        NOT(ISPICKVAL(Offer_Declined__c, "")),
        NOT(ISPICKVAL( Offer_Not_Extended__c , ""))
    )
)