Ask Search:
Peter MartensenPeter Martensen 

I need help with a validation rule

I need help with this validation rule.  I want to make the Sent_to_Client_Date__c field required when any of the three picklist values are choosen.  But it makes the field required when other picklist values are choosen also.  Thanks
OR(
ISPICKVAL( StageName,"Quote/Proposal"),
 ISPICKVAL( StageName,"Closed Lost"),
ISPICKVAL( StageName,"Closed Won"),
AND(
  ISBLANK(Sent_to_Client_Date__c )))
Best Answer chosen by Peter Martensen
Kishore B TKishore B T
  Please try this, 
  AND(
    CASE(
        StageName,
        "Quote/Proposal",    1,
        "Closed Lost",           1,
        "Closed Won",        1,
        0
    ) = 1,
    ISBLANK(Sent_to_Client_Date__c)
)

All Answers

Kishore B TKishore B T
  Please try this, 
  AND(
    CASE(
        StageName,
        "Quote/Proposal",    1,
        "Closed Lost",           1,
        "Closed Won",        1,
        0
    ) = 1,
    ISBLANK(Sent_to_Client_Date__c)
)
This was selected as the best answer
Alexis KSIGZKIEWICZAlexis KSIGZKIEWICZ
Hello Peter,

The formula language is a prefixed language, so your logical has to be as following:

AND(
ISBLANK(Sent_to_Client_Date__c ),
OR(
ISPICKVAL( StageName,"Quote/Proposal"),
ISPICKVAL( StageName,"Closed Lost"),
ISPICKVAL( StageName,"Closed Won")
)
)

Alexis
Peter MartensenPeter Martensen
Thanks to both of you.  I was already trying Kishore's answer when Alexis responded.