Set calendar (date/time)

Actions – Abstract

This allows the calendar used by a Datumsfeld to be set. As an input value of the action, both the ID of a calendar and a calendar instance (e.g. dynamically created in a Client workflow) are accepted.

This allows the calendar used by a Datumsfeld to be set. As an input value of the action, both the ID of a calendar and a calendar instance (e.g. dynamically created in a Client workflow) are accepted.

Example 1: Search and load calendar

A common use for the 'Set calendar' action is to search for a calendar using a Suchverhalten. It is recommended that calendars are identified by their name, not by their ID, as this can vary from system to system (transfer forms from one system). For this purpose, a behaviour 'loadCalendar' is defined for a date field, which should be called when the form data is loaded. Additionally, the date field activates the option 'Working days only'.

images/download/attachments/189434777/image-2024-11-7_9-18-50-version-1-modificationdate-1730967529207-api-v2.png

In the search behaviour, the calendar with the static name 'Default calendar' is searched, which is then passed to the action 'Set calendar'.

images/download/attachments/189434777/image2020-8-24_16-47-8-version-1-modificationdate-1729150182140-api-v2.png

Result:

images/download/attachments/189434777/image2020-8-24_16-48-42-version-1-modificationdate-1729150182120-api-v2.png

Example 2: Dynamic addition of calendar exceptions

The date value Departure date planned of a shipment should be visually displayed in the calendar of the field Departure date actual, and declared as a selectable day independent of the stored calendar.

A calendar called 'Default calendar' already exists in the system and it defines basic holidays and working days.

images/download/attachments/189434777/image2020-8-24_15-35-44-version-1-modificationdate-1729150182168-api-v2.png


To implement the example, the date range element Departure date planned is assigned the behaviour 'Changed'. This executes a Client workflow, which determines a calendar instance and passes it on to the Actions on 'true'.

images/download/attachments/189434777/image-2024-11-7_10-13-35-version-1-modificationdate-1730970814453-api-v2.png

The changed date range is passed to the Client workflow as a variable 'source' (1) (DateTime). The resulting calendar is then written to the variable 'calendar' (2) in the workflow.

As an Action on 'true', 'Set calendar' is executed on the date range element Departure date actual.

images/download/attachments/189434777/image-2024-11-6_16-34-2-version-1-modificationdate-1730907241277-api-v2.png

In the Client workflow (Rule: Statically true), the calendar with the name 'Default calendar' is searched for and written into the variable 'calendar'.

images/download/attachments/189434777/image2020-8-24_15-56-18-version-1-modificationdate-1729150182160-api-v2.png

A new calendar exception is added via the triggering event List item (1). As a little trick, this new instance is immediately processed in an Execute with action to directly access its object fields (2).

The 'Set Value' actions are explained below.

images/download/attachments/189434777/image2020-8-24_16-12-29-version-1-modificationdate-1729150182157-api-v2.png

(A) The date for the exception is set to the value of Departure date planned, which was passed to the client workflow as the variable 'source' (see above).

(B) 'Working day' is selected as the exception type, since this date should now be selectable independently of regular working days.

(C) The exception should be highlighted with a green color (decimal code 6487936.

(D) The label is specified as a 'Localized label' instance, through which a resource bundle (E) and name (F) can be defined.

(E) The language administration bundle of the label.

(F) The resource name of the label.


For the date field Departure date actual, the option 'Working days only' was activated, which shows Saturdays and Sundays as non-selectable days due to the default calendar. However, in the result screenshot at the beginning of this example, it becomes clear that the exception overrides this rule because the type of exception is a 'working day'.