Linked

images/download/attachments/62850455/image2018-9-3_15_37_36-version-1-modificationdate-1603454691280-api-v2.png

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.