Generate barcodes (Shipment)

Event action – Abstract

Purpose: Fills barcode attributes of line items of a shipment with values from a number range. Optionally, the number of barcode attributes within a line item is synchronized with the "Number of packages" of the same line item by adding or removing barcode attributes, if necessary.

See also: Generate barcodes, Generate barcodes (Order)

images/download/attachments/177912634/image-2024-9-19_11-56-12-version-1-modificationdate-1726739771679-api-v2.png

The Generate barcodes (Shipment) event action generates barcodes via a specific Number range type (see Number range) in order to assign these 'empty' instances of barcode attributes to relevant line items of a reference object of the Shipments type as 'barcode' (barcode).

Relevant line items can alternatively be defined using one of the following methods.

  • The Line items parameter allows an explicit definition of the relevant line items via a Resolvers that provides a list of Line items (e.g. Direct line items and/or Rule list resolver).

  • The Line item types parameter defines one or more Line item types by multiple selection (see Line item type). All line items that belong to a selected Line item type are considered to be relevant.

  • If no information is available for any of these parameters, all line items with the Line item type 'Default' (DEFAULT) are considered relevant.

All relevant line items are processed according to the following schema:

  1. If the Sync barcodes with number of packages option is selected in the Generate barcodes (Shipment), the number of barcode attribute instances within the line item is matched to the 'number of packages' (numberOfPackages):

    1. If the line item currently contains more barcode attribute instances than the Number of packages field specifies, then 'excess' instances of the barcode attribute are removed from the end of the list. It does not matter if they are already assigned barcodes.

    2. If the item currently contains fewer barcode attribute instances than the Number of packages field indicates, then additional instances of the barcode attribute are added to the list at the end.

  2. All barcode attributes contained in the item whose 'Barcode' (barcode) field is empty are assigned an automatically generated value depending on the specified Number range type.

NOTE◄ Which of the Number range configured for the selected Number range type are used to generate barcode values depends on the evaluation of their Association criteria according to the best-matching principle.

IMPORTANT◄ If no number range is assigned for the Number range type for the call context or the assigned number range does not provide any more values, some or all 'Barcode' fields will not be populated. If this results in barcode duplicates for the same line item, the reference object cannot be saved in this state (see 'Barcode attributes background', above).

NOTE◄ For background information on barcodes and an illustrative runtime example, see the page for the Common business object:

Configuration

The Generate barcodes (Shipment) event action expects a shipment (see Shipments) as the reference object. In the context of another object type, the event action has no effect without an error occurring at runtime.

The selection for the Number range type parameter (required field) controls which Number range are candidates for generating barcode values. The selection is made by association according to the best-matching principle (see Association criteria).

The Sync barcodes with number of packages option can be selected to ensure that the number of barcode attribute instances exactly matches the 'number of packages' (numberOfPackages) of the line item for all relevant line items. Based on the given 'Number of packages' line items, 'surplus' barcode attribute instances are removed or 'missing' ones are added as required for this purpose and automatically assigned a barcode value from the applicable number range.

The Sync barcodes with number of packages option is deselected by default. Then the 'Barcode' field – if empty – is only filled for barcode attribute instances that already exist in the volatile data of the reference object.

images/download/attachments/177912634/image-2024-9-19_11-56-27-version-1-modificationdate-1726739787245-api-v2.png

The Line items parameter can be used to explicitly define, via a Resolvers, relevant line items whose barcode attributes are processed by the event action.

  • In the example on the right, all direct line items for the Line item type 'Service' are determined via the Direct line items value resolver.

    NOTE◄ The result for the selection of relevant line items is identical to the selection of 'Service' in the Line item types parameter (see below) only if the reference object for this Line item type does not contain any child items. Otherwise, child items are not processed because the Direct line items value resolver does not list them.

  • As soon as a Resolvers is configured for the Line items parameter, the Line item types disactivated parameter appears. It becomes active again only when the Resolvers in the Line Resolvers parameter is removed.

  • The parameter can only be configured if no Line item types (see below) have been selected yet.

images/download/attachments/177912634/image-2024-9-19_11-57-10-version-1-modificationdate-1726739829897-api-v2.png

Alternatively, the Line item types parameter can be used to define relevant line items whose barcode attributes are to be processed by the event action in a blanket manner via their Line item type.

  • In the example on the right, the Line item type 'Default' has already been selected. In addition, the Line item type 'Service' is selected, which was looked up in the image using the search function of the Multiselect combobox. This selection must be confirmed by pressing the enter key or by clicking on the images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg symbol.

  • A selection for Line item types is only possible if no explicit definition of the relevant line items is configured under Line Items.

  • As soon as a selection is made for one or more Line item types, the configuration for the Line items parameter is deactivated.

NOTE◄ Only if there is neither a configuration under Line items nor a selection under Line item types, all line items with the Line item type 'Default' (DEFAULT) are considered as relevant.

images/download/attachments/177912634/image-2024-9-19_11-57-55-version-1-modificationdate-1726739874752-api-v2.png