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
David ODavid O 

Validation Rule help

I am trying to create a validation rule that should be basic but is not firing for me.

 

I have a picklist called  Prefix__c that has several values in it,

 

I want to fire if PICVAL is = to "Maintenance (CMT)", or "Maintenance Renewal (CMR)" and the custom date field of Maintenance_Start_Date__c is blank so that the date field becomes required,

 

This is what I have in place now, that is not working

 

AND(OR(ISPICKVAL(Prefix__c, "Maintenance (CMT)"),ISPICKVAL(Prefix__c, "Maintenance Renewal (CMR)")),ISBLANK(Maintenance_Start_Date__c))

 

Any assistance would be appreciated..

ynwaynwa

Hi David O,

 

You need to add if statements. Try below:

 

AND(

        OR(IF(ISPICKVAL(Prefix__c, "Maintenance (CMT)"), True, False),

               IF(ISPICKVAL(Prefix__c, "Maintenance Renewal (CMR)")), True,False)),

        ISBLANK(Maintenance_Start_Date__c))

 

Cheers,

ynwa

 

David ODavid O

Thanks ynwa,

 

I am getting a syntax error wih that statement...  Syntax error. Extra ','

 

ynwaynwa

sorry about that try below:

 

AND(OR(IF(ISPICKVAL(Prefix__c, "Maintenance (CMT)"), True, False),IF(ISPICKVAL(Prefix__c, "Maintenance Renewal (CMR)"), True,False)), ISBLANK(Maintenance_Start_Date__c))

David ODavid O

Thanks for the help on this, it ended up being a corrupt field, I had to rebuild my picklist from scratch in order for the validation to work.