Add tracking status

Event action – Abstract

Purpose: Creates a new tracking status entry to be added to the Tracking state history of a reference object (business transaction object or line item). The new entry is stored in a variable so that it can be edited by subsequent event actions.


images/download/attachments/189442603/image-2024-12-17_9-21-26-version-1-modificationdate-1734423685668-api-v2.png

The Trackingstatus hinzufügen event action creates a new tracking status entry (baseTS:TrackingStatusEntry) to be added to the Tracking state history of reference objects.

Suitable reference objects for adding Tracking state entries are business transaction objects and sometimes their positions according to the following overview:

Business transaction object

Tracking status
at header level

Tracking status
at item level

Common business object

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

Orders

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

Shipments

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

Manifests

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg

Time slot book entry
(see Time slot management)

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg

NOTE

  • If the reference object is an item of a business transaction object, the restrictions in the section 'Adding tracking status to line items of a business transaction object' (see below) must be observed.

  • Provided that the addition of the tracking status entry can be completed successfully AND this requires the change of at least one tracking status attribute of the reference object (see step 3 in the following section or explanations for Tracking state transformations), the reference object is saved when the transaction is completed. This also takes into account any changes made to the related object data until the transaction is completed – regardless of whether these take place before or after the call to Add tracking status.

NOTE◄ If the reference object is a line item of a transaction object, updating at least one tracking status attribute of the line item also marks the entire transaction object to be saved at the end of the transaction. If a corresponding event handling is triggered while the business transaction object is open in a input form within the same session, this may cause unsaved changes to be lost.

Procedures for adding a tracking status entry

Step 1: Create new tracking status entry and initialize if applicable

Created a new instance for a tracking status entry (baseTS:TrackingStatusEntry).

  • If Tracking state is selected for the Tracking status configuration parameter, it will be assigned to the 'Tracking status.code' field (trackingStatus.code).

IMPORTANT◄ If the selection of a Tracking state is omitted in the configuration, then it must be assigned via event actions in the following section Customize TS with <entity type>, otherwise an error with a rollback occurs ('No tracking status available').

NOTE◄ The same error occurs if the added tracking status does not exist in the relevant system, e.g. because the relevant master data was deleted after the event action was configured.

Step 2: Customize tracking status entry (optional)

Below the configuration parameters, a block of event actions is provided, which is typically used to adjust the newly created tracking status entry – e.g. taking into account data from the reference object.

  • For these event actions, the reference object to which the tracking status is to be added remains unchanged, and not the new tracking status entry, for example. This is also reflected in the label (Customize TS with <entity type>), where the name for the '<entity type>' of the reference object appears in the configuration.

  • Assignments for tracking status entry fields are typically made by Set value event actions. The access to the new tracking status entry object is provided by a variable whose name must be defined in the parameter Name of TS variable. By default, the variable name trackingStatus is preset there.

Step 3: Add tracking status, if permitted

Finally, the new tracking status entry should be created and therefore added to the reference object's tracking status history. If a tracking status workflow (Tracking state workflows) is applicable for the data context, its configuration determines under which conditions the added tracking status is considered valid or not against the background of the existing tracking status history for the reference object (see Tracking state workflows). The test is performed according to the following scheme:

  1. The added tracking status entry is chronologically ranked in the existing history based on the date/time value in the 'External input time' (externalInput) field. Entries without any specification for the 'External input time' beforehand are ranked instead via the 'Created date' (created). Unless an 'External input time' was explicitly defined in step 2 for the added tracking status, the current system time applies to it.

  2. Before the added tracking status entry is saved and thus accepted as an element of the Tracking state history, the Tracking state history modified by the additional entry is checked for the validity of the Tracking state transformations against the background of the Tracking state transformation matrices for the applicable tracking status workflow. Each of these matrices refers to a specific Tracking state type. At the same time, the reference object provides a specific 'current tracking status' (or tracking status attribute) for each Tracking state type, which may be changed by adding a tracking status. Depending on the 'Calculation mode' for the respective matrix, the check of the Tracking state transformations starts with the beginning of the tracking status history or only from the entry currently registered as 'current' for the respective Tracking state type. The added entry is considered valid only if it can be achieved against the background of at least one of the Tracking state transformation matrices via valid Tracking state transformations.

NOTE◄ This does not necessarily mean that the added entry becomes the current entry for the respective Tracking state type, especially when backdated entries are added to an existing history.

Adding Tracking status entries to line items of a business transaction object

►NOTE◄ Tracking status entries are not supported for line items of Manifests (see Working with tracking states) since these are by definition Shipments that themselves have tracking status attributes.

When the 'Add tracking status' action is used to add a tracking status to a line item of a business object, the internal ID of the business object must be available in the respective property of the line item:

Business object type

Property name

Common business object

commonId

Order

orderId

Shipment

shipmentId

Typically, these fields are not populated with data in the client. Instead, they are initialized automatically with the ID of the business object before event actions are executed. This automatism provides the required input for the event action, with the exception of the following special cases:

  1. The line item to which the new tracking status entry should be added, was added to the business object in the course of the ongoing event handling transaction. Since the line item did not exist when the transaction started, it did not get initialized. This case can be covered by a Set value event action to initialize the respective property (see table above) with the ID before calling 'Add tracking status'.

  2. The business transaction object has not yet been saved or the current transaction was triggered by the 'Create' event for the business transaction object (see Common action event ). In this case, there is not yet an ID for the transaction object that could be entered. However, no tracking status can be added interactively to a transaction object that has not yet been saved.

Configuration

images/download/attachments/189442603/image-2024-12-17_9-21-36-version-1-modificationdate-1734423695558-api-v2.png

The Tracking state code for the added tracking status entry can optionally be selected in the Tracking status parameter. All Tracking state codes that have read access in the login context are available for selection.

NOTE◄ If an existing event handling is edited in which there is no read access for the already configured Tracking state code, the caption may not appear in the label. Nevertheless, the selection remains valid. However, it cannot be deselected and then reselected in the session in question.

The Name of TS variable name parameter is optional, but must specify a variable name for the newly created tracking status entry if access to the tracking status entry is required for the event actions in the block Customize TS with <entity type>. Therefore, by default, the variable name trackingStatus is preset.

Using the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg symbol, event actions can be added in the Customize TS with <entity type> section. These are executed after creating the new tracking status entry, but before attempting to add it to the Tracking state history of the reference object.

NOTE◄ The entity type of the reference object appears in the label above the block to indicate that this reference object also applies to the event actions inserted here. Both the data of the reference object and that of the new tracking status entry can still be adjusted in this block before checking whether the tracking status entry may be added and, if so, with what consequences.

Example: Adding a Tracking status to a shipment

In the following example, a Tracking status 'GO!' is added to a shipment and the 'Comment' (comment) Object property of the new tracking status entry should be populated with the text from the 'text value' (textValue) of the Text attribute 'Route' of the shipment.

images/download/attachments/189442603/image2019-5-10_14-51-10-version-1-modificationdate-1734421332877-api-v2.png