Restrict back dating and future date when selecting calendar date in NAV 2018

311 Views Asked by At

I have a date field which the user will select from the calendar dropdown, now I want only the current date to be selected, future date and backdating should not be allowed. I am using Microsoft dynamics NAV 2018.

1

There are 1 best solutions below

1
Mak Sim On

Your only option is to put some code with conditions checks to OnValidate trigger of the field you want to restrict. There is no way to change calendar behavior.

Put either of this into your OnValidate trigger of the date field

Testfield(”Your field”, today());

Or

Testfield(”Your field”, workdate());