
I'm new to formulas when creating validations. I have managed to get the following to work in our sandbox so that if a date is selected, and the reason field is blank, it will display an error message, prompting the user to enter a reason for the short lead time.
AND(( Tender_Close_Date__c <= TODAY() +6),
ISBLANK( Reason_for_Pending_Tender_Close_Date__c ))
What I have realised is, I will need to also incorporate a condition that, only when the opportunity record is new is when the validation should fire. And that It should only count weekdays.
With help from searching here, I was able to get the weekdays formula working using this:
AND(Tender_Close_Date__c <=
(CASE(MOD(TODAY() - DATE (2000 ,1, 2) ,7),
0,TODAY() + 6,
1,TODAY() + 6,
2,TODAY() + 6,
3,TODAY() + 8,
4,TODAY() + 8,
5,TODAY() + 8,
6,TODAY() + 5, NULL)))
But no luck with the ISBLANK(Reason_for_Pending_Tender_Close_Date__c) or ISNEW requirements.
Am I trying to incorporate too much, can someone way more savy than me provide some guidance?
Thanks,
Matthew
답변 3개

Thanks Adrienne, Do you mean one validation rule on the 'close date' to enforce the weekday rule, and another on the 'reason' to enforce that it is not blank?