ES | EN
  • Apps
  • Support
  • iDynamics Website
    Mostrar / Ocultar índice

    Personalization - iDynamics EDI

    Introduction

    iDynamics EDI permite configurar los mensajes de EDI más habituales, incluyendo aquellos que no vienen soportados de serie en el producto (ej. recepción de albaranes de compra). Si miramos los objetos incluidos en iDynamics EDI, encontraremos las siguientes Codeunits:

    Codeunits de mensajes EDI

    Cada una de ellas se corresponde a un tipo de mensaje EDI, incluyendo aquellos que son configurables pero que no vienen implementados, y todas ellas contienen alguno de los eventos descritos a continuación, según correspondan al tipo de mensaje.

    Exporting Messages

    The following events will be available in those codeunit that export messages to be sent through EDI.

    OnBeforeExport

    OnBeforeExport(SourceDoc, MsgConfig, Handled, FileName);
    

    This event is launched before the export process of any EDI message begins. The parameters are as follows:

    • SourceDoc. The NAV document to be sent via EDI. The name of this parameter varies from Codeunit, depending on the type of document.
    • MsgConfig. The configuration record (table 7142722) that applies to this document, as configures for the client/supplier.
    • Handled. This boolean, passed by reference, allows to completely replace the standard logic. If we create our own custom export code, assigning this value to "Yes" will indicate to iDynamics EDI that the file has already been processed, and it is not necessary to execute the default logic.
    • FileName. In case Handled is Yes, the path of the exported file by the process that captured the event (or empty, if there had been any problem).

    To avoid confusion: the last two values are launched by the event so that, in the custom code you add, you can indicate that there has been a customization, and replace the standard export code (or implements it, if it does not exists for the type of message).

    Tip

    This event it is intended to completely reimplement the export of the message file. If you only want to modify the value of some of the data included in the message (with respect to the document generated by the standard), we recommend you to use the events OnBeforeWrite, described below.

    OnBeforeWrite

    OnBeforeWriteXXX(OutText; SourceDoc)
    

    Within each of the export codeunits you will find events like the previous one, in which XXX corresponds to one of the line types contained in the document. This event is released once the line has already been generated in memory, but just before being written to disk. The received parameters are:

    • OutText. The line to be written to disk. The value is received by reference and can be modified to vary the content of the generated file.
    • SourceDoc. The register from which the previous line of text was generated.

    OnAfterExport

    OnAfterExport(FileName,SourceDoc);
    

    This event is called after you have finished exporting the message file. The parameters are as follows:

    • FileName. The path of the file exported by the process, if it has been generated successfully.
    • SourceDoc. The record from which the message was generated.

    Importing Messages

    The following events will be available in those codeunits that import messages received through EDI.

    OnBeforeImport

    OnBeforeImport(MsgConfig, Handled);
    

    This event is launched in the message import codeunits, before staring the process. The parameters are as follows:

    • MsgConfig. The setup record (table 7142722) that applies to this document, as configured sor the customer/provider.
    • Handled. This boolean, passed by reference, allows to completely replace the standard logic. If we create our own custom import code, assigning this value to "Yes" will indicate to iDynamics EDI that the process has already been performed and it is not necessary to execute the default load logic.

    OnAfterRead

    OnAfterXXX(NewRecord; ReadText);
    

    Within the import codeunits, we will find several OnAfter events, referring to the progressing of the different lines/documents that can be included within a message. The different events will follow the following parameter structure:

    • NewRecord. The record that has been created in NAV from the processed text line.
    • ReadText. The line of text that has been read within the EDI message to generate the previous record.
    Back home Copyright © 2024 iDynamics Business Solutions