Use this event to
Override lists of barcodes returned for an item in a semi-colon separated format.
Used by Planned Functions
Description
This event is triggered in procedure GetBarcodeList. The procedure returns all barcodes registered for an item in a semi-colon separated list. This list can be interpreted by the mobile device and is sent out in the ItemBarcode element on the order lines.
You can use the event to override the standard functionality by filling the _BarcodeListToReturn variable and setting the parameter _Handled to true.
Template
// [Template]
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Item Reference Mgt.", 'OnBeforeGetBarcodeList', '', true, true)]
local procedure OnBeforeGetBarcodeList(_ItemNo: Code[20]; _VariantCode: Code[10]; var _BarcodeListToReturn: Text; var _IsHandled: Boolean)
begin
end;
Example
// [Example]: Add Item GTIN to _BarcodeList
[EventSubscriber(ObjectType::Codeunit, Codeunit::"MOB Item Reference Mgt.", 'OnBeforeGetBarcodeList', '', true, true)]
local procedure MyOnBeforeGetBarcodeList(_ItemNo: Code[20]; _VariantCode: Code[10]; var _BarcodeListToReturn: Text; var _IsHandled: Boolean)
var
Item: Record Item;
begin
// Intentionally do not exit here if _IsHandled but always add GTIN to BarcodeList
if Item.Get(_ItemNo) then
if _BarcodeListToReturn = '' then
_BarcodeListToReturn := Item.GTIN
else
_BarcodeListToReturn += ';' + Item.GTIN;
_IsHandled := true;
end;
More examples
There are no items with the selected labels at this time.
Version History
Version | Changes |
---|---|
MOB5.26 | Introduced |