Show / Hide Table of Contents

    How to Create a Custom Integration Type

    Each type of integration will need it's own special handling. In the Integration Queue this is solved by implementing a new Integration Type.

    How does an Integration Type work

    An Integration Type handles the integration in one or more steps, each step committed to the database before the next step is started. The implementation of an Integration Type specifies what steps are needed for this Integration Type and what codeunit will be responsible for handling that step. A last step is always added automatically to all Integration Types: Archive

    1. Implement the "IQ Integration Type" interface

    Create a new codeunit that implements the "IQ Integration Type" interface.

    codeunit 50000 "[My Handler Codeunit]" implements "QWESR IQ Integration Type"
    

    Look at the Sample Integration Type to get inspiration and documentation of the interface and how it can be implemented.

    All functions in the interface must be implemented.

    There are several Events that can be used by an Integration Type, but they should only be used if necessary. The events can be found in the Codeunit Integration Type Mgt..

    2. Define all the steps

    All steps that an integration needs are defined in the Enum "QWESR IQ Step". The Enum "QWESR IQ Step" can be extended with new steps, if a step with a suitable name does not exist. There are no logic connected to each step, except the Archive step. All business logic for each step must be defined by the Integration Type.

    In the implementation of function GetIntegrationSteps() you will need to define all the steps that are needed in this integration. The steps are defined by calling the AddIntegrationStep() function. The codeunit ID passed as parameter could either point to one single codeunit (even this Handler codeunit, as in the example below) or it could be split into several different codeunits.

        procedure GetIntegrationSteps(IntegrationType: Codeunit "QWESR Integration Type Mgt."; var IQStepOrder: Record "QWESR tIQStepOrder" temporary)
        begin
            IntegrationType.AddIntegrationStep("QWESR IQ Integration Type"::"[My Integration Type]", IQStepOrder, "QWESR IQ Step"::"[My First Step]", Codeunit::"[My Handler Codeunit]");
            IntegrationType.AddIntegrationStep("QWESR IQ Integration Type"::"[My Integration Type]", IQStepOrder, "QWESR IQ Step"::"[My Second Step]", Codeunit::"[My Handler Codeunit]");
            IntegrationType.AddIntegrationStep("QWESR IQ Integration Type"::"[My Integration Type]", IQStepOrder, "QWESR IQ Step"::"[My Third Step]", Codeunit::"[My Handler Codeunit]");
        end;
    

    3. Implement all the steps

    All codeunits that are added as a step in GetIntegrationSteps() above must have the "Integration Queue" table as source table, since the it's OnRun() trigger will be called for each step with the Integration Queue record as input parameter.

        TableNo = "QWESR Integration Queue";
    

    4. Extend the Interface Enum

    To add your Integration Type as a selectable Integration Type in the UI, you need to extend the Integration Type Enum called "QWESR IQ Integration Type". The new Enum value added in this Enum Extension is the link to your Handler Codeunit.

    1. Create a new Enum Extension that extends the Enum "QWESR IQ Integration Type"
    2. Add a new enum value. Use the codeunit ID as the value and set a descriptive name and caption. In the Implementation property you configure your handler codeunit. See below example:
    enumextension 50001 "[My IQIT Extension]" extends "QWESR IQ Integration Type"
    {
        value(50001; "[My Integration Type]")
        {
            Caption = '[My Integration Type]';
            Implementation = "QWESR IQ Integration Type" = "[My Handler Codeunit]";
        }
    }
    

    Sample

    Look at the Sample Integration Type for inspiration on how to implement the handling of each step when using a single codeunit for all steps.

    See Also

    Sample Integration Type
    Interfaces

    Back to top Copyright © 2020 SmartApps
    Generated by DocFX