Don't get lost: Training » Sage 200 Training Manual » Step 8 - Auditing

8 - Auditing

One of the key features of IMan is the ability to tailor and configure the Audit Report which is produced each time an integration runs.

In this step you will learn how to set up and configure these functions. See Audit Report, Auditing, and Log Keys in the IMan User Guide for more details.

If we save the integration and run it from the scheduler, you will receive an audit report similar to the following. It lists a couple of warnings, but does not let you know the details of customers or orders you imported.

Successful integrations are ones that not only work, but guide users to the offending data when they do not.

Action On Transform Error

At the very top of the Audit tab is a drop-down which controls error handling.

In most transforms you would leave the Action set to Abort, which means the transform will abort, causing the whole integration to stop processing.

On Connectors you need to think about how you want IMan to handle errors. IMan has three possible settings:

  1. Abort
    • The whole process will stop.
  2. Reject Record
    • This will cause IMan to process the valid transactions but reject erroneous transactions. IMan understands the concept of an atomic transaction i.e. an Order, Despatch, Customer or Item, and will not leave half written records, ever! If an Order has an invalid item code the entire order is rejected not just the invalid lines.

If for example, you were importing StockItems with associated suppliers, if one of the suppliers were invalid it would reject the entire StockItem and not leave a half written item.

  1. Continue
    • Deprecated. DO NOT USE.

Add Customer Import Summary

In this step we will add a summary to show the number of customers that were imported and the number of errors.

  1. Go back to the designer and open the Sage200 connector for the Customer import.
  2. Click on the Audit Tab
  1. Summary Header
    • Enter: Customer Import
  2. Audit Summary
    • Enter (as a single line):
      %Customer.PROCESSED Customer Processed. %Customer.ERRORS Errors. %Customer.INSERTED Inserted. %Customer.UPDATED Updated.
  1. Save integration, and run the Scheduler (Scheduling and Running Integrations. You will now see in the summary some count information regarding the Customer Import.

Add Order Import Summary

In this step we will:

  • Add a summary for the number of orders processed, created and errors.
  • Create a list to show the incoming order Id against the Sage200 Order Id.

Connector > Audit

  1. Go back to the designer and open the Sage200 connector for the Order import & click on the Audit Tab.
  1. Action On Transform Error
    • Set to Reject Record.

In our integration, the Order Import will be set to Reject Record whereas the Customer import was left to Abort. The effect as follows:

  • Order Import - Reject Record

If the Action on Transform Error is set to Abort on the Order Import, the process will stop at that point, leaving the Orders in Sage that were successfully processed up to the point of the error. The successfully processed orders would probably need deleting prior re-running the import, otherwise duplicates could occur. By setting to Reject Record, any erroneous Orders will be rejected, but processing will continue and complete. Erroneous orders will need remedial action.

  • Customer Import - Abort

If there is an error during the Customer import stage, the entire integration will stop.

The Customer import can be run multiple times without their being a risk of duplicated data.

The Customer import will insert ONLY new records and update existing ones.

It is worth noting that there are more advanced scenarios than described in this training, involving filters and lookups to prevent duplicates.

  1. In the Summary Header enter:
    • Order Import
  2. In the Audit Summary:
    • %SOPOrder.PROCESSED Orders Processed. %SOPOrder.INSERTED Orders Created. %SOPOrder.ERRORS Errors.
  1. Add a second audit summary which will list the orders processed and the corresponding Sage300 order number.
    • Web Order %SOPOrder.CustomerDocumentNo – Sage200 Order %SOPOrder.DocumentNo

Connector > Field Mapping

We will also set the log key fields to help identify the Order transaction (and details) in the detail audit log whenever there is a warning or error.

  1. Click on the Field Mapping tab and press the Edit button for the Order transaction type.
  2. Change Log Key value to '1' for the 'OrderId' field.

  1. Save by pressing the Green Tick.
  2. Select the 'OrderDetail' transaction Id.
  3. Press Edit:
  1. OrderId
    • Set LogKey to'1'
  2. SkuCode
    • Set LogKey to '2'

This will mean that the Summary in the Audit Report is populated with the Order Id and SkuCode!
  1. Save, and go to the schedule and run the integration.

  1. Open the Orders File in Excel (located in \InputData) and change one of the item codes within the file to something invalid.

  1. Save the file and re-run the import from the scheduler.

Using the Log Key for Unmapped Fields

In the previous section, it was noted that fields which are not mapped do not flow out the other side of the connector.

An unmapped field can be made to flow out the other side by setting the Log Key to a non-zero value.

If the Log Key value of the field is set incrementally starting from 1 it will become part of the value which is written to the source column on the event of an error or warning.

To make a field ‘flow’ but not set have it be part of the Source column set the value to a non-linear value. I.e. Set the value to 20 and increment for every field thereafter.