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
AAIAAI 

validation rule subject and picklist

I create the folllowing validation rule. I would need that the subject field is not blank when the mail received and mail sent are selected.
Any idea why doesn´t work?

Thanks in advance.

IF(
   AND (
        ISBLANK (Subject),

         OR(
           ISPICKVAL( Type ,"Mail received" ),

               ISPICKVAL ( Type ,"Mail sent" ))), true, false)
Best Answer chosen by AAI
Abdul KhatriAbdul Khatri
I am not sure what SObject you are referring here, if it is Task then Subject is a mandatory field if not then the below code must work. You don't need IF 
 
AND 
(
ISBLANK ( Subject ),
OR(
ISPICKVAL( Type ,"Mail received" ),
ISPICKVAL (  Type ,"Mail sent" )
  )
)

 

All Answers

Abdul KhatriAbdul Khatri
I am not sure what SObject you are referring here, if it is Task then Subject is a mandatory field if not then the below code must work. You don't need IF 
 
AND 
(
ISBLANK ( Subject ),
OR(
ISPICKVAL( Type ,"Mail received" ),
ISPICKVAL (  Type ,"Mail sent" )
  )
)

 
This was selected as the best answer
Abdul KhatriAbdul Khatri
Was this helpful?
Abdul KhatriAbdul Khatri
Please let me know if that helped and If Yes, please marke it Resolved and make it a best answer. I appreciate you response in this regard