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
Nik MilaserdovNik Milaserdov 

Salesforce sardart Calendar/Datepicker question with date

Can i make a rule, that will prohibit to choose a date from the future?  Or cant save that date, even i choose date from the future?

Khan AnasKhan Anas (Salesforce Developers) 
Hi Nik,

Greetings to you!

You can use below validation rule.
 
DATEVALUE(Your_Date_Time_Field__c) > TODAY()

Note: Use insert field option to use the correct Date/Time field in the formula.
If you want to have an accurate time as well along, if its a datetime then you can use below rule:
 
Your_Date_Time_Field__c > NOW()

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas