Table of Contents

Set Calculated Date - Code: CALCDATE

General

This page contains the JSON of the function-set Code: CALCDATE

This function is very useful when dates have to be calculated, including workingday functionality. The following default functions can be used in the function:

Code Description
CD Current day
CW Current week
CM Current month
CY Current year

Some examples of functions with relative dates:

Value Description
-1M The same date in the previous month.
+2W The same day, in 2 weeks from now.
CM+14D 14 days from the end of the month.
CY-1Y The first day of last year.

Json code snippet: CALCDATE determinate first day of last year.


{
  "FunctionSet": {
    "TableNo": 0,
    "Entries": [
      {
        "EntryNo": "10000",
        "CodeunitID": "11172846",
        "FunctionCode": "CALCDATE",
        "Parameters": [
          {
            "ParameterName": "DATE FORMULA",
            "Value": "CY-1Y "
          },
          {
            "ParameterName": "RETURN WORKDAY",
            "Value": "true"
          }
        ]
      }
    ]
  }
}