Add to export job
Event action – Abstract
Purpose: If a single entity of an exportable type exists as a reference object, it is added to an existing or newly created Export job.
The Add to export job event action attempts to add an entity that exists as a reference object to an existing or newly created export job.
An exportable entity (see Meta Exchange extension) is expected as the reference object.
If the reference object is 'No value' ($null), the event action has no effect.
If the reference object is not an entity, an error message (and possibly a rollback) is triggered when Add to export job is executed.
If the reference object is an entity of a type that cannot be exported, the event action has no effect.
If an Export job already exists in the context of the session at runtime, the current reference object (including all dependent entities) is then added to it.
If no Export job exists yet, a new one is created when the Add to export job event action is executed.
►NOTE◄
The Add to export job event action is available in Event handling and Client workflows.
The Add to export job event action is not executed in Tests for Event handling, but is executed in test mode for the Form designer when called in a Client workflow.
Interactive export vs. automation
Executing the Add to export job event action largely matches the execution of the ribbon macro command 'Export/Export' (see Available commands) in the context of an entity.
The system does not check whether the Role of session applicable in the execution context has the authorization to export (~/Export/Export) for the specific entity type to which the reference object belongs.
This means that the event action can also be executed for entities in whose context the 'Export/Export' ribbon command is not available.
While the interactive export can be executed in the context of an overview for a multiple selection of entities (of the same type), the Add to export job event action does not accept a list of entities as a reference object. Therefore, to automatically add several entities to an Export job, several instances of the Add to export job event action or a For each loop event action must be used.
Configuration
The Add to export job event action does not use any parameters.
Examples
Simple use case
The user account with which the Company of session was created should be added to the current Export job in the context of event handling.
Configuration:
The value configuration for the Object resolver parameter determines the reference object to be exported via the following value resolver chain (see Chained resolver) within the Execute with event action displayed on the right:
In the Execute with event action block, the Add to export job event action adds the identified user account to the Export job. |
|
More complex use case
In the context of event handling, all holiday groups (see Holiday groups) that contain at least one entry for the current year are added to an Export job.
A view is then opened for the Export job, if not already the case.
Configuration:
The holiday groups to be exported are determined in advance using the Search event action shown on the right:
►NOTE◄ Not selecting a Time zone indicates that the time zone applicable in the execution context is used. This is done on the assumption that the entries in the holiday group have been maintained for the same time zone. This can certainly have an effect on the search result, as the following example shows:
|
|
The screenshot on the right shows the Search event action described in detail above (here: collapsed), after which a For each loop action is executed:
►NOTE◄ For simplification, we have assumed here that the event handling is executed in the context of a session with the ‘Super user’ role (or at least the corresponding permissions). It is generally recommended to execute an Export job. If the Search needs to take owner restrictions into account so that only holiday groups that the Company of session is authorized to ‘read’ are exported, the Search must be used in the action block of a Run as event action with a ‘restricted’ role. |
|
The screenshot on the right shows the configuration for an Open view (Action), which opens a view for the Export job if one does not yet exist:
►NOTE◄ The menu node name can only be used to specify the View name to be opened if the Export job menu item is available in the session. This is only the case if the Role of session has the authorisation ‘Administration/System/Import Job’ (administration/system/importJob). Using the view name, however, the Open view (Action) can also display the view for the Export job in a session in which the ‘Administration/System/Import job’ authorisation is not available and in which the Export job and Import job menu items are not available: de.lobster.scm.exchange::ExchangeIndex|listDetailsWindow The Export job view is a combined view for the ‘Exchange index’ (ExchangeIndex) class. |
|