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:
- Abort
- The whole process will stop.
- 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.
- 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.
- 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.
- Go back to the designer and open the Sage200 connector for the Customer import.
- Click on the Audit Tab
- Summary Header
- Enter: Customer Import
- Enter: Customer Import
- Audit Summary
- Enter (as a single line):
%Customer.PROCESSED Customer Processed. %Customer.ERRORS Errors. %Customer.INSERTED Inserted. %Customer.UPDATED Updated.
- Enter (as a single line):
- 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
- Go back to the designer and open the Sage200 connector for the Order import & click on the Audit Tab.
- 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.
- In the Summary Header enter:
- Order Import
- In the Audit Summary:
- %SOPOrder.PROCESSED Orders Processed. %SOPOrder.INSERTED Orders Created. %SOPOrder.ERRORS Errors.
- 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.
- Click on the Field Mapping tab and press the Edit button for the Order transaction type.
- Change Log Key value to '1' for the 'OrderId' field.
- Save by pressing the Green Tick.
- Select the 'OrderDetail' transaction Id.
- Press Edit:
- OrderId
- Set LogKey to'1'
- SkuCode
- Set LogKey to '2'
- Save, and go to the schedule and run the integration.
- Open the Orders File in Excel (located in \InputData) and change one of the item codes within the file to something invalid.
- 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.