You need to sign in to do that
Don't have an account?
Rajesh Singh 88
validation rule on date field as per the weekday picklist values
I have the below 2 fields :
Weekdays__c (Multiselect picklist) which contains the values as below :
Monday
Tuesday
Wednesday
Thursday
Friday
ExpirationDate__c (Date)
My requirement is whenever the picklist values are selected as Monday;Tuesday OR Tuesday;Wednesday;Friday with multiple combinations the date should fall within any of the selected weekdays from the multi-picklist else throw validation.
Example : User selected the Weekday valules as Monday;Tuesday and the selected date is not falling Monday or Tuesday then throw validation. As in the current month Monday is falling on 7, 14, 21 , 28 dates or same in the case of Tuesday so if the user selects date falling on Monday or Tuesday then allow to save the record.
I am a newbie to the sfdc world and I have tried in multiple ways to achieve but couldn't able to.
For single value I was able to as below but with multiple combinations I wasn't able to do.
AND(INCLUDES(Weekdays__c, "Monday"),
MOD( ExpirationDate__c - DATE(1900, 1, 6), 7) <> 2)
Weekdays__c (Multiselect picklist) which contains the values as below :
Monday
Tuesday
Wednesday
Thursday
Friday
ExpirationDate__c (Date)
My requirement is whenever the picklist values are selected as Monday;Tuesday OR Tuesday;Wednesday;Friday with multiple combinations the date should fall within any of the selected weekdays from the multi-picklist else throw validation.
Example : User selected the Weekday valules as Monday;Tuesday and the selected date is not falling Monday or Tuesday then throw validation. As in the current month Monday is falling on 7, 14, 21 , 28 dates or same in the case of Tuesday so if the user selects date falling on Monday or Tuesday then allow to save the record.
I am a newbie to the sfdc world and I have tried in multiple ways to achieve but couldn't able to.
For single value I was able to as below but with multiple combinations I wasn't able to do.
AND(INCLUDES(Weekdays__c, "Monday"),
MOD( ExpirationDate__c - DATE(1900, 1, 6), 7) <> 2)
All Answers