CALE_LOOK_AHEAD
Script Function: Returns the next date based on calendar conditions.
Syntax
CALE_LOOK_AHEAD ([[Date Format]:Date], JOBP\JSCH, Task Number)
CALE_LOOK_AHEAD ([[Date Format]:Date], Condition, Calendar, Calendar Keyword [ [,Calendar][,Calendar Keyword] ]...)
Syntax |
Description/Format |
---|---|
Date |
|
JOBP\JSCH |
Name of a workflow or schedule |
Task Number |
Task number in the workflow or the schedule |
Condition |
Condition that must apply for the definition of date Allowed values: "ONE", "ALL", "NO" "ONE" - One of the given calendar conditions must apply If no calendar condition applies for a task, a SPACE is returned. In this case, CALE_LOOK_AHEAD_MAX is displayed in the Schedule Monitor (see Monitoring Schedules). |
Calendar |
Name of a calendar |
Calendar Keyword |
Calendar keyword in this calendar |
Return codes |
---|
Date in the specified format |
Comments
The script function may be used in two different ways.
On the one hand, it is possible to determine a respective object's next date of execution according to given calendar conditions. The object can be identified by its task number, which is displayed in the graphical picture of the workflow in the order in which the objects were added to the workflow. The schedule shows the objects, which are numbered according to their order in the list of the Schedule tab.
On the other hand, the script function supports the calculation of the next date on which one, all, or no calendar conditions apply. Up to five calendars may be specified, including calendar keywords. The maximum number of days that are to be considered when checking for the next valid date may be specified for each client by the administrator in the variable UC_CLIENT_SETTINGS with the key "CALE_LOOK_AHEAD_MAX".
It is possible to specify the date from which on calendar conditions should be checked. Optionally, you may specify a particular Date Format. The default Date Formats to be used are "YYMMDD" or "YYYYMMDD". A colon or semicolon may be used as a separator between Date Format and Date. If no date is specified, the particular current date is used for calculation.
This script function supplies the date either in the default format or in the format that has been defined in its first parameter.
Please note that the parameters Calendar and Calendar Keyword must always be used together (see example below).
Examples
The following example shows how to identify the next date on which the object with task number "3" will run in the workflow "MM.DAY".
:SET &DATE# = CALE_LOOK_AHEAD('YYYYMMDD:20041010','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:
Script Elements - Date and Time
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function