Skip to content

KVSEDX GS1 BMS INVOIC IMP#

Events#

OnAfterAssignVariableHeaderData(Record KVSEDX Purchase Header, XmlAttributeCollection, XmlNode, Boolean) :#

Summary: The OnAfterAssignVariableHeaderData event is fired when an avpList is processed in the order header. The "KVSEDX Purchase Header" is already inserted at this time. The GS1XmlAttributeCollection can be used to query the attribute of the avpList element. GS1AttributeValuePairXmlNode contains the corresponding value.

[IntegrationEvent(true, false)]
local procedure OnAfterAssignVariableHeaderData(var KVSEDXPurchaseHeader: Record "KVSEDX Purchase Header"; GS1XmlAttributeCollection: XmlAttributeCollection; GS1AttributeValuePairXmlNode: XmlNode; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSEDX GS1 BMS INVOIC IMP", 'OnAfterAssignVariableHeaderData', '', false, false)]
local procedure DoSomethingOnAfterAssignVariableHeaderData(var KVSEDXPurchaseHeader: Record "KVSEDX Purchase Header"; GS1XmlAttributeCollection: XmlAttributeCollection; GS1AttributeValuePairXmlNode: XmlNode; var IsHandled: Boolean)
begin
end;

Parameters:

  • KVSEDXPurchaseHeader: Current KVSEDX Purchase Header
  • GS1XmlAttributeCollection: Attribute Collection for this AttributeValuePair
  • GS1AttributeValuePairXmlNode: Node with Value
  • IsHandled: Set to true if custom logic has handled the processing

Example:

foreach GS1XmlAttribute in GS1XmlAttributeCollection do
    if (GS1XmlAttribute.Name = 'attributeName') then
        case GS1XmlAttribute.Value of
            'PROJ_DATA_1':
                KVSEDXPurchaseHeader."Project Field 1" := CopyStr(GS1XmlNode.AsXmlElement().InnerText, 1, MaxStrLen(KVSEDXPurchaseHeader."Project Field 1"));
            'PROJ_DATA_2':
                KVSEDXPurchaseHeader."Project Field 2" := CopyStr(GS1XmlNode.AsXmlElement().InnerText, 1, MaxStrLen(KVSEDXPurchaseHeader."Project Field 2"));
        end;
KVSEDXPurchaseHeader.Modify(true);

OnBeforeProcessHeader(Record KVSEDX Purchase Header, XmlNamespaceManager, XmlElement, XmlNode, Boolean) :#

Summary: Integration event fired before processing a GS1 invoice header document. This event allows subscribers to perform custom preprocessing or validation before the standard header processing begins. Use this event to implement custom business logic, field mappings, or data validation for invoice headers.

[IntegrationEvent(true, false)]
local procedure OnBeforeProcessHeader(var KVSEDXPurchaseHeader: Record "KVSEDX Purchase Header"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1XmlRootElement: XmlElement; var GS1OrderXmlNode: XmlNode; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSEDX GS1 BMS INVOIC IMP", 'OnBeforeProcessHeader', '', false, false)]
local procedure DoSomethingOnBeforeProcessHeader(var KVSEDXPurchaseHeader: Record "KVSEDX Purchase Header"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1XmlRootElement: XmlElement; var GS1OrderXmlNode: XmlNode; var IsHandled: Boolean)
begin
end;

Parameters:

  • KVSEDXPurchaseHeader: The KVSEDX purchase header record being processed
  • GS1XmlNamespaceManager: The XML namespace manager for GS1 document navigation
  • GS1XmlRootElement: The root XML element of the GS1 invoice document
  • GS1OrderXmlNode: The current invoice XML node being processed
  • IsHandled: Set to true if the subscriber has handled the processing and wants to skip standard processing

OnAfterProcessHeader(Record KVSEDX Purchase Header, XmlNamespaceManager, XmlElement, XmlNode, Boolean) :#

Summary: Integration event fired after processing a GS1 invoice header document. This event allows subscribers to perform custom postprocessing after the standard header processing is complete. Use this event to implement additional business logic, custom field updates, or integration with external systems.

[IntegrationEvent(true, false)]
local procedure OnAfterProcessHeader(var KVSEDXPurchaseHeader: Record "KVSEDX Purchase Header"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1XmlRootElement: XmlElement; var GS1OrderXmlNode: XmlNode; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSEDX GS1 BMS INVOIC IMP", 'OnAfterProcessHeader', '', false, false)]
local procedure DoSomethingOnAfterProcessHeader(var KVSEDXPurchaseHeader: Record "KVSEDX Purchase Header"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1XmlRootElement: XmlElement; var GS1OrderXmlNode: XmlNode; var IsHandled: Boolean)
begin
end;

Parameters:

  • KVSEDXPurchaseHeader: The KVSEDX purchase header record that was processed
  • GS1XmlNamespaceManager: The XML namespace manager for GS1 document navigation
  • GS1XmlRootElement: The root XML element of the GS1 invoice document
  • GS1OrderXmlNode: The current invoice XML node that was processed
  • IsHandled: Set to true if the subscriber has performed additional processing that should affect subsequent operations

OnAfterAssignVariableLineData(Record KVSEDX Purchase Line, XmlNodeList, Boolean) :#

Summary: The OnAfterAssignVariableLineData event is fired when an avpList is processed in the order line. The "KVSEDX Purchase Line" is already inserted at this time. The GS1XmlAttributeCollection can be used to query the attribute of the avpList element. GS1AttributeValuePairXmlNode contains the corresponding value.

[IntegrationEvent(true, false)]
local procedure OnAfterAssignVariableLineData(var KVSEDXPurchaseLine: Record "KVSEDX Purchase Line"; GS1AttributeValuePairXmlNodeList: XmlNodeList; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSEDX GS1 BMS INVOIC IMP", 'OnAfterAssignVariableLineData', '', false, false)]
local procedure DoSomethingOnAfterAssignVariableLineData(var KVSEDXPurchaseLine: Record "KVSEDX Purchase Line"; GS1AttributeValuePairXmlNodeList: XmlNodeList; var IsHandled: Boolean)
begin
end;

Parameters:

  • KVSEDXPurchaseLine: Current KVSEDX Purchase Line
  • GS1AttributeValuePairXmlNodeList: Node with Value
  • IsHandled: Set to true if custom logic has handled the processing

Example:

foreach GS1AttributeValuePairXmlNode in GS1AttributeValuePairXmlNodeList do begin
  GS1XmlAttributeCollection := GS1AttributeValuePairXmlNode.AsXmlElement().Attributes();
  if (GS1XmlAttributeCollection.Count > 0) then begin
      foreach GS1XmlAttribute in GS1XmlAttributeCollection do
        if (GS1XmlAttribute.Name = 'attributeName') then
          case GS1XmlAttribute.Value of
              'PROJ_DATA_1':
                  KVSEDXPurchaseLine."Project Field 1" := CopyStr(GS1XmlNode.AsXmlElement().InnerText, 1, MaxStrLen(KVSEDXPurchaseLine."Project Field 1"));
              'PROJ_DATA_2':
                  KVSEDXPurchaseLine."Project Field 2" := CopyStr(GS1XmlNode.AsXmlElement().InnerText, 1, MaxStrLen(KVSEDXPurchaseLine."Project Field 2"));
  end;
KVSEDXPurchaseLine.Modify(true);

OnBeforeProcessLine(Record KVSEDX Purchase Line, XmlNamespaceManager, XmlNode, Boolean) :#

Summary: Integration event fired before processing a GS1 invoice line item. This event allows subscribers to perform custom preprocessing or validation before the standard line processing begins. Use this event to implement custom line-level business logic, item mappings, price validations, or quantity checks.

[IntegrationEvent(true, false)]
local procedure OnBeforeProcessLine(var KVSEDXPurchaseLine: Record "KVSEDX Purchase Line"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1LineXmlNode: XmlNode; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSEDX GS1 BMS INVOIC IMP", 'OnBeforeProcessLine', '', false, false)]
local procedure DoSomethingOnBeforeProcessLine(var KVSEDXPurchaseLine: Record "KVSEDX Purchase Line"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1LineXmlNode: XmlNode; var IsHandled: Boolean)
begin
end;

Parameters:

  • KVSEDXPurchaseLine: The KVSEDX purchase line record being processed
  • GS1XmlNamespaceManager: The XML namespace manager for GS1 document navigation
  • GS1LineXmlNode: The current invoice line XML node being processed
  • IsHandled: Set to true if the subscriber has handled the processing and wants to skip standard processing

OnAfterProcessLine(Record KVSEDX Purchase Line, XmlNamespaceManager, XmlNode, Boolean) :#

Summary: Integration event fired after processing a GS1 invoice line item. This event allows subscribers to perform custom postprocessing after the standard line processing is complete. Use this event to implement additional line-level business logic, custom calculations, tax calculations, or integration workflows.

[IntegrationEvent(true, false)]
local procedure OnAfterProcessLine(var KVSEDXPurchaseLine: Record "KVSEDX Purchase Line"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1LineXmlNode: XmlNode; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSEDX GS1 BMS INVOIC IMP", 'OnAfterProcessLine', '', false, false)]
local procedure DoSomethingOnAfterProcessLine(var KVSEDXPurchaseLine: Record "KVSEDX Purchase Line"; var GS1XmlNamespaceManager: XmlNamespaceManager; var GS1LineXmlNode: XmlNode; var IsHandled: Boolean)
begin
end;

Parameters:

  • KVSEDXPurchaseLine: The KVSEDX purchase line record that was processed
  • GS1XmlNamespaceManager: The XML namespace manager for GS1 document navigation
  • GS1LineXmlNode: The current invoice line XML node that was processed
  • IsHandled: Set to true if the subscriber has performed additional processing that should affect subsequent operations