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
Karim BAHAJIKarim BAHAJI 

Validation rule for due date for response

Hi,

I need to make a validation rule on a date field, and my requirement is that the due date may not be less than 2 days.

Do you know how the formula for this requirement please?

Thanks
Best Answer chosen by Karim BAHAJI
Parker EdelmannParker Edelmann
You can use "Due_Date__c < NOW() + 2 && ISNEW()"

All Answers

Parker EdelmannParker Edelmann
If I understand correctly, the validation rule should go as follows:
Due_Date__c < TODAY +2
If you are using a Date/Time field like the DueDate field on tasks, use NOW() instead of TODAY()

Hope this helps,
Parker
AG_SFDCAG_SFDC
Hello,

Try this:

User-added image

I have tested it and it works!

let me know if this helped you!

Thanks,
AG
Karim BAHAJIKarim BAHAJI
Thanks a lot ! it Works with a Date/Time field
Due_Date__c < Now() +2

 
Karim BAHAJIKarim BAHAJI
Hi,

Just one question, the validation rule works on creation, but when i edit the record few days after the validation rule "Works" and block the saving of the record.

Do you have a solution that will make the validation rule works only on creation?

Thanks
Parker EdelmannParker Edelmann
You can use "Due_Date__c < NOW() + 2 && ISNEW()"
This was selected as the best answer
Karim BAHAJIKarim BAHAJI
It works ! Thanks a lot Parker Edelmann. Have a nice Week end.
Parker EdelmannParker Edelmann
Thanks! And have a good Week end yourself.