WORKDATE function
Many standard NAV routines default dates to Work Date rather than to the system date. When a user logs into the system, the Work Date is initially set equal to the System Date. But at any time, the operator can set the Work Date to any date by accessing the Application Menu, clicking on Set Work Date…, and then entering the new Work Date.
The user can also click on the Work Date displayed in the status bar at the bottom of the RTC. The following screenshot shows the Set Work Date screen:
For data entry purposes, the current Work Date can be entered by the operator by simply typing the letter w
or W
, or the word WORKDATE,
in the date entry field. NAV will automatically convert that entry to the current Work Date.
The syntax for getting the current WorkDate
value from within the C/AL code is as follows:
DateField := WORKDATE;
The syntax for setting the WorkDate
to a new date from within the C/AL code is as follows:
WORKDATE(newdate);