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.
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 |
Tracking status |
|
|
|
|
|
|
|
|
|
|
|
|
Time slot book entry |
|
|
►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.
For the evaluation of Association criteria for Tracking state workflows, the potentially modified volatile data status of the reference object at the time of the call of the Add tracking status event action is the deciding factor. Unsaved changes to the reference object made prior to Add tracking status can affect the 'mapping' of Tracking state workflows. This can be critical to whether the desired tracking status entry can be added and the transaction completed.
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:
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'.
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
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
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.