axaptadynamics-ax-2012-r2aif

Microsoft AX Dynamics Process Integration through Outbound Ports


I would like to know the Process Integration steps.

Through Outbound ports

If any of the event occurs at AX Dynamics, we just want to know that events in the form of XML(Process Integration).

Example: Sales Order Creation, Customer Creation, Purchase Order Creation..


Solution

  • Outbound ports are only useful for asynchronous communication.

    See AX 2012 Export Data with Outbound ports for an example (using the file system).

    The steps to initiate sending data is in the AIF_SendCustomer.

    As this is no lightweight operation, you may consider logging the records which needs integration in a custom integration table, then doing the processing in batch.

    This is done in the insert and/or update and maybe delete method. Deletes requires you store the RecId field value in the external system to be used for delete requests. The following does not cover this.

    For logged table make the following method:

    void syncRecord()
    {
        XXXRecordLog log;
        log.RefTableId = this.TableId;
        log.RefRecId = this.RecId;
        log.insert();
    }
    

    Then call this.syncRecord() in the insert and update methods.

    In the query to the outbound service be sure to exists join your table and the log table. This way only changed records are exported.

    Make a batch job to do the transfer using the AIF_SendCustomer as a template. After a synchronous (AifSendMode::Sync) transfer of the records, delete the log records (or mark them transferred).

    Finally call AIFoutboundProcessingService to flush the file:

    new AIFoutboundProcessingService().run();
    

    Try to keeps things simple. It might be simpler to do a comma file export of the changed records!