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
Renee KroonRenee Kroon 

if date field is filled AND field ISPICKVAL is null

Hello,

I need some help with the creation of a formula for a validation rule.

When a certain date field (DATEFIELD_c) is filled AND a Pickval field (PICKVALFIELD_c) is Empty, show message that PICKVALFIELD-c must be filled by user.

Thank you for your help.
Best Answer chosen by Renee Kroon
ShivankurShivankur (Salesforce Developers) 
Hi Renee,

You can use formula something like below:
AND (
  ISBLANK(TEXT(Picklist_field__c)),
  NOT(ISBLANK(Date_Field__c))
)
In error message configuration, you can set the message like - 'Picklist_field__c must be filled by user.'

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
 

All Answers

ShivankurShivankur (Salesforce Developers) 
Hi Renee,

You can use formula something like below:
AND (
  ISBLANK(TEXT(Picklist_field__c)),
  NOT(ISBLANK(Date_Field__c))
)
In error message configuration, you can set the message like - 'Picklist_field__c must be filled by user.'

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks.
 
This was selected as the best answer
AbhinavAbhinav (Salesforce Developers) 
Hi Renee

You can try something similar

AND((!(ISBLANK( testDateField__c ) )), ISBLANK(TEXT( testPicklistField__c  )) )

Please mark as best answer so that it can help others in future.

Thanks!
CharuDuttCharuDutt
Hii Renee Kroon
Try The Below Validation Rule
AND (ISBLANK(TEXT(PicklistFieldName )),NOT(ISBLANK( DateFieldName )))
In Error Location Section Select Field Option  And Field Name From Drop DownList On Which Field You Want To Show Error On


Please Mark It As Best Answer If It Helps
Thank You!