Linked
The 'Linked' event is triggered when clicking the Link line items button (see image below), which can be used in input forms for business objects in a 'Link line item' element on any position level.
The link is actually established independently of the use of the button by making a selection in the 'Link line item' element for the 'Link line item' in a 'Linked business object' (in the image: shipment) and saving this two-part reference with the data of the edited business object. In the following very simple example, three items in one shipment refer to a specific item (No. 1) in another shipment (No. 3001).
The Link line items button, which appears in each line item in the example, can optionally be used to trigger specific actions via the 'Linked' event.
On the one hand, the data of the business object are available as data context for the event. On the other hand, two variables are assigned information from the item where the button was activated:
Variable name |
Data type |
Content |
Reference to the example data (see below) |
lineItemId |
Long |
the system-wide unique ID of the line item assigned internally by Lobster Data Platform / Orchestration |
< lineItem id="2651" ... > |
lineItemIndex |
String |
the automatically assigned value for the Position no. |
<lineItem id="2651" ... lineItemId="1" ... > |
Example
The following excerpt from the XML structure for the items (lineItems) of a shipment is intended to clarify which properties from the data model are assigned to the variables and how the link is embedded in the data structure of the item.
<lineItems>
[...] <lineItem id="2651" [...] lineItemId="1" parentLineItemId=""> <attributes> <shp:ShipmentLineItemLinkedLineItem id="501" [...]> <value linkedBtoId="3001" linkedBtoType="shp:Shipment" linkedLineItemId="2452" linkedLineItemType="shp:ShipmentLineItem" type="INTERSHIP"/> </shp:ShipmentLineItemLinkedLineItem> </attributes> </lineItem></lineItems>
►CAUTION◄ The association of the variable names can be confusing because the Variable lineItemId is not assigned the value of the property lineItemId (Position no.), but the id of the lineItems . Within the link, the linkedLineItemId property refers to the id of the linked item and not to its lineItemId ('Position no.). The distinction between 'ID' and 'Positions no.' is important because the value of the 'Positions no.' can change spontaneously when positions are deleted or added. On the other hand, the 'ID' of a position remains stable from the creation to the deletion of the position.