CALE_LOOK_AHEAD

Use the CALE_LOOK_AHEAD script function in two ways. In Workflows or Schedules, you can determine the next execution date of an included object depending on its calendar conditions. The particular task number identifies the object. For details about task numbers, see Task Boxes in Workflows, for example. Alternatively, you can use this script function to calculate the next date on which one, all, or no calendar conditions apply. You can define a maximum of five Calendars, including Calendar events. The administrator can specify the maximum number of days that should be considered for each client in the UC_CLIENT_SETTINGS variable with the CALE_LOOK_AHEAD_MAX key, see CALENDAR Parameters.

Syntax

CALE_LOOK_AHEAD ([[Date Format]:Date], JOBP|JSCH, Task Number)
CALE_LOOK_AHEAD ([[Date Format]:Date], Condition, Calendar, Calendar Event [ [,Calendar][,Calendar Event] ]...)

Parameters

  • CALE_LOOK_AHEAD
    Returns the next date based on calendar conditions
  • Date
    (Optional) Define the date from which on the calendar condition should be checked. If no date is specified, the current date is used for the calculation.
  • (missing or bad snippet)
  • JOBP|JSCH
    Name of a workflow or schedule
    Format: script literal or script variable
  • Task Number
    Task number in the workflow or schedule
    Format: script literal or script variable
  • Condition
    A condition that must comply with the date definition. If no calendar condition applies to a task, this script function returns a blank. In this case, CALE_LOOK_AHEAD_MAX is displayed in the Schedule Monitor (see Monitoring Schedules).
    Format: script literal or script variable
    Allowed values:

    • ONE
      One of the given calendar conditions must apply
    • ALL
      All the given calendar conditions must apply
    • NO
      None of the given calendar conditions must apply
  • Calendar
    (Optional) Name of a Calendar object
    Format: script literal or script variable
  • Calendar Event
    (Optional) Calendar Event in the Calendar object. Always use this parameter together with the Calendar parameter.
    Format: script literal or script variable

Return codes

  • Date in the specified format
  • " "
    No calendar condition applies


Examples

The following example shows how you can identify the next date on which the object with task number 3 will run in the MM.DAY workflow.

:SET  &DATE# = CALE_LOOK_AHEAD('YYYYMMDD:20201010','MM.DAY','3')

The second example identifies the next date on which all assigned calendar conditions apply.

:SET  &DATE# = CALE_LOOK_AHEAD(,'ALL','FIRM.CALENDAR','WORKDAYS','FIRM.CALENDAR','READINESS01')

See also: