1. SOP Despatch

Map Transform

In this step will be add an empty field to the dataset which in turn will be mapped to the SOP Order Detail to capture the line id generated by Sage200 when the order is created.

  1. Re-open the integration created in the first section of the training guide
  2. Click on the Transform Setup tab.
  3. Open the Map transform.

  1. Open the Map transform and add two new fields to the OrderDetail transaction type:
  1. Name
    • Sage200LineId
  2. Field Type
    • Text
  3. Enable Script Evaluation
    • Unchecked
  4. Formula
    • Empty
  1. Name
    • AllocationQty
  2. Field Type
    • Decimal
  3. Enable Script Evaluation
    • Checked
  4. Formula
    • %Qty
  1. Press Refresh until you can see the new fields:

  1. Press Apply to save the transform and then Close.

Sage200 Order Connector

This step will be used to capture the auto-generated Line Id.

  1. Re-open the Sage200 Order connector.

  1. Click on the Field Mapping tab and change the Transaction Id to OrderDetails.
  2. Edit the field mapping so the new detail fields created in the previous step are mapped to the ‘SOPOrder Return Line Id’ and ‘To Allocate Qty’.

  1. Save the grid and press Refresh to re-generate the orders.
  2. If the orders are successfully generated the SOPOrderReturnLine field will be populated with the auto-generated Sage line id.
    • This field will be used later to allow us to control which order lines to generate a despatch document with!

PostOrderMap

In this step we will add two fields to the IMan dataset to allow us to generate the despatch document.

  1. Add a Map transform to the end of Sage200 Order Connector.

  1. Click the Field Mapping tab.
  2. Add two fields to the data set as per the following:
  1. Name
    • DespatchNumber
  2. Field Type
    • Text
  3. Enable Script Evaluation
    • Unchecked
  4. Formula
    • Empty
  1. Name
    • DoDespatches
  2. Field Type
    • Boolean
  3. Enable Script Evaluation
    • Checked
  4. Formula
    • True

  1. Press Refresh to generate the new data set with the fields.

  1. Press Apply to save then close.

Filter the Non-Stock Lines

Before we can create the despatch, the non-stock lines (charges and comments) must be filtered from the dataset otherwise an error will occur since these lines cannot be despatched.

  1. Add a Filter transform to the Map transform created in the previous step.

  1. Click the Field Mapping tab.
  2. Change the Transaction Id to SOPOrderLine.
  1. Enter the formula:
    • %SOPLineType = 0

  1. Press Refresh to check the only the Stock lines remain in the dataset, then press Apply to Save, then close.

Despatch the Order

In this step you will create a despatch against the order.

  1. Add another Sage200 Connector to the integration and connect it to the Filter transform created in the previous step.

  1. Open the connector and select the company, and select ‘SOP Despatch’ from the Import Type drop down.

  1. Click the Field Mapping tab.
  2. Map the incoming transaction ‘SOPOrder’ to the ‘SOP Despatch/Receipt’.

  1. Click the edit button under the grid to map the Order Header fields:

Incoming Field

Map To Sage200 Field

DocumentNo

Order Return No

DespatchNumber

Despatch Receipt Number

DoDespatches

Do Despatches

  1. Press the Green Tick to save the grid.
  2. Select the SOPOrderLine from the Transaction Id drop down.
  3. Select Line Item from the Sage200 Transaction Type drop down.

To switch or change the Field Mapping grid being displayed, change theTransaction Id drop down. Changing the Transaction Type drop down alters the Transaction Type to which the top is mapped.

  1. Click the edit button under the grid to map the Order Detail fields.
Incoming Field Map To Sage300 Field

LineQuantity

Quantity

SOPOrderReturnLine

SOPOrder Return Line

The key here is to set the Line Number field from the order to the SOPOrder Return Line field. This will ensure the correct detail is updated with the relevant quantities.

  1. Press Refresh and if successful the Preview will display the auto-generated despatch number.

  1. Press Apply to save and then close.

Preparing to Generate the O/E Invoice

This step will simply add a single field to the dataset to allow us to print & post the invoice.

  1. Add a Map transform to the Sage200 Despatch created in the previous step.

  1. Click the Field Mapping tab.
  2. Make sure SOPDespatchReceiptAdjustment is selected from the drop down.
  3. Add five new fields as per the following:
  1. Name
    • DocumentType
  2. Field Type
    • Integer
  3. Enable Script Evaluation
    • Unchecked
  4. Formula
    • 0 (Zero, denotes an invoice, as opposed to Credit)
  1. Name
    • ExportPath
  2. Field Type
    • Text
  3. Enable Script Evaluation
    • Checked
  4. Formula
    • "C:\IMan\OutputData\" & %INVNUMBER & ".pdf"

Replace the first part of the path with the IMan shared data directory.

  1. Name
    • InvoiceNo
  2. Field Type
    • Text
  3. Enable Script Evaluation
    • Unchecked
  4. Formula
    • Empty
  1. Name
    • PostInvoice
  2. Field Type
    • Boolean
  3. Enable Script Evaluation
    • Unchecked
  4. Formula
    • True
  1. Name
    • Layout
  2. Field Type
    • Text
  3. Enable Script Evaluation
    • Checked
  4. Formula
    • "Layouts\SOP Invoice (Single).layout"
  1. Press Refresh.

  1. Press Apply to save then Close.