Gets and sets the work date for the current session.

[WorkDate]:= WORKDATE([NewDate])

Parameters

NewDate

Type: DateThe new work date you want to set. If you omit this value the function returns the current work date.

Property Value/Return Value

Type: Date

The current work date.

Remarks

This function returns the work date chosen using the Work Date option on the Tools menu. If the user did not select a work date, then the current system date is returned.

Example

This example shows how to use the WORKDATE function. This example requires that you create the following text constant in the C/AL Globals window.

Name ConstValue

Text000

The work date is: %1

  Copy Code
WORKDATE(010114D);
MESSAGE(Text000, WORKDATE);

The first line of code sets the work date to January 1, 2014. In the second line of code, the WORKDATE function returns the current work date. On a computer that has the regional format set to English (United States), the message window displays the following:

The work date is: 01/01/14

See Also