Skip to content

1. Create Shipments & Invoices

The order import created orders. In this section you ship them, and Sage 300 raises the invoice from the shipment in the same operation. One Refresh produces a shipment number and an invoice number for every order.

Sage 300 generates three of the numbers involved: the order line number, the shipment number and the invoice number. You capture each one the same way, as you captured Sage300OrderNumber in 6.1.

Map > Field Mapping

The order detail lines need to carry the line number Sage 300 assigns them. The shipment uses it to match each of its lines to the right order line.

  1. Re-open the integration and press the Transform Setup tab.
  2. Open the Map transform and press Field Mapping.
  3. Set Current Transaction Id to OrderDetails.
  4. Press Add and fill the dialog:

    1. New Field Name
      • For training, enter: Sage300LineId
    2. Type
      • For training, select: Integer. It will hold a line number.
    3. Evaluate
      • For training, leave unticked.
    4. Evaluate String
      • Leave empty. The field must be blank. The connector puts the value Sage 300 generates into it.

    The Field Mapping dialog creating a new field called Sage300LineId, of type Integer, with Evaluate unticked and no formula

  5. Press the green tick. The new field appears at the end of the grid.

    The OrderDetails field grid with Sage300LineId added as the tenth row, typed Integer with no formula

  6. Press Refresh, then Close to commit the transform, and save the integration.

An empty field mapped in the connector comes back populated

Sage300OrderNumber, which the Map already carries on the Orders transaction, works the same way. When you map an empty field to a Sage 300 field in the connector, it comes back populated.

Sage 300 Order Connector > Field Mapping

  1. Open the Sage 300 Order connector and press Field Mapping.
  2. Set Current Transaction Id to OrderDetails.
  3. Press Edit, and on the Sage300LineId row set Sage 300 Field to Line Number (LINENUM).
  4. Press Save on the grid.

    The order connector's OrderDetails mapping with Sage300LineId mapped to Line Number LINENUM and its Import box ticked

Choosing a Sage 300 field ticks that row's Import box for you. A field with Import ticked flows out of the connector to the transforms downstream.

The connector renames fields to their Sage 300 names on the way out

The connector renames fields to their Sage 300 names on the way out. Downstream of this connector the transactions are OE0520 and OE0500, and the field you just created appears as LINENUM, not as Sage300LineId. You see the name you chose only here.

Without this mapping, LINENUM is not in the connector's output and the shipment has nothing to match its lines against.

Press Refresh to re-generate the orders, then Close and save.

Design > Transform Setup

You need two fields to receive the shipment and invoice numbers, and one to ask Sage 300 for the invoice. They go in a separate Map transform connected to the order connector.

  1. Open the Transforms group in the palette and drag a Map onto the design surface, below the Sage 300 Order connector.
  2. Drag a Connector from the same group and join the order connector to it.
  3. Save the integration. You cannot open a newly dropped transform until you do.

    The design surface with a new Map transform below the Sage 300 order connector, forming a second branch alongside the CSV writer

The order connector now feeds two branches: the CSV writer built in step 9, and this one.

Post Order Map > Field Mapping

Double-click the new transform to open it. On its Setup tab set Transform Id to POSTORDERMAP. It arrives called Map_1, and the audit report shows whatever id you give it.

Press Field Mapping and leave Current Transaction Id on OE0520, the order header. Press Add three times, once per field:

  1. New Field Name
    • ShipmentNumber
  2. Type
    • Text
  3. Evaluate
    • Unticked
  4. Evaluate String
    • Empty
  1. New Field Name
    • InvoiceNumber
  2. Type
    • Text
  3. Evaluate
    • Unticked
  4. Evaluate String
    • Empty
  1. New Field Name
    • CreateInvoice
  2. Type
    • Boolean
  3. Evaluate
    • Ticked
  4. Evaluate String
    • True

The POSTORDERMAP field grid on transaction OE0520, showing the twelve inherited Sage 300 fields followed by ShipmentNumber, InvoiceNumber and CreateInvoice

The first two are empty for the same reason as Sage300LineId. CreateInvoice carries a value. It tells Sage 300 to raise an invoice from the shipment straight away, instead of leaving the shipment to be invoiced later.

Press Refresh. The three new columns appear on the preview. The first two are empty and the third is True.

The POSTORDERMAP preview showing ORDNUMBER populated with three order numbers, ShipmentNumber and InvoiceNumber empty, and CreateInvoice True

Press Close and save the integration.

Sage 300 Shipment Connector > Setup

  1. Open the Connectors group in the palette and drag a Sage 300 connector onto the design surface, to the right of the Map you just built.
  2. Join the Map to it with a Connector, and save.
  3. Double-click it to open it.
  1. Transform Id
    • For training, enter: SHIPMENT
  2. Sage 300 Connector
    • The Sage 300 company to write to. Choose this first. Until it is set, the Import Type list below is disabled and empty.
    • For training, select your Sage 300 SAMLTD connection.
  3. Sage 300 Import Type
    • For training, select: O/E Shipment
  4. Update Operation
    • For training, leave as: Insert

The shipment connector's Setup tab with Transform Id SHIPMENT, the SAMLTD training connection, Sage 300 Import Type O/E Shipment and Update Operation Insert

Set the import type before you build the mapping

Set the import type before you build the mapping. After you configure the connector the field is disabled, because a new type would invalidate every mapping underneath it. If you pick the wrong one, delete the transform and start again.

Sage 300 Shipment Connector > Field Mapping

The connector receives two transactions from upstream: OE0520, the order header, and OE0500, the order lines. Map each one to the Sage 300 transaction it becomes.

  1. Press Field Mapping. Current Transaction Id is on OE0520.
  2. Set Sage 300 Transaction Type to Shipments (OE0692).

    The field mapping tab showing Current Transaction Id OE0520 mapped to Sage 300 Transaction Type Shipments, and a Transaction Level Mapping summary reading OE0520 to OE0692 and OE0500 not mapped

    The Transaction Level Mapping panel underneath summarises what is mapped to what. Check it as you go.

  3. Press Edit and map the order header fields:

    Incoming Field Map To Sage 300 Field
    ORDNUMBER Order Number (ORDNUMBER)
    ShipmentNumber Shipment Number (SHINUMBER)
    InvoiceNumber Invoice Number (INVNUMBER)
    CreateInvoice Create Invoice from Shipment (CREATEINV)
  4. Press Save on the grid.

    The shipment header mapping with ORDNUMBER, ShipmentNumber, InvoiceNumber and CreateInvoice each mapped to their Sage 300 field

  5. Change Current Transaction Id to OE0500, then set Sage 300 Transaction Type to Shipment Details (OE0691).

The two drop-downs do different jobs

To change which grid you are looking at, use the top drop-down, Current Transaction Id. The bottom one, Sage 300 Transaction Type, changes what the top one is mapped to.

  1. Press Edit and map the order line fields:

    Incoming Field Map To Sage 300 Field
    QTYORDERED Quantity Shipped (QTYSHIPPED)
    LINENUM Order Line Number (ORDLINENUM)
  2. Press Save on the grid.

    The shipment detail mapping with QTYORDERED mapped to Quantity Shipped and LINENUM mapped to Order Line Number

Map to Order Line Number, not Line Number

Map LINENUM to Order Line Number, not to Line Number. Both exist on the shipment detail and they mean different things. Line Number is the shipment's own line. Order Line Number is the order line that this shipment line fulfils. Only the second ties the quantity to the right detail.

You created Sage300LineId at the start of this section for this purpose. The Quick Start manual expands this scenario in SAMACCINTCO (Sample Sage300 Intercompany Processing Automation).

Running it

Press Refresh. Sage 300 creates the shipments and raises an invoice from each one. Both generated numbers come back onto the preview:

The shipment connector's preview on transaction OE0692, showing three orders each with a generated shipment number and invoice number, and CreateInvoice True

Press Close and save the integration.

Every Refresh of this connector ships and invoices again

Every Refresh of this connector ships and invoices again. That works while it receives new orders. It is a problem when the orders are not new.

Refreshing a transform downstream of this connector reuses a cached copy of the data before it, so the connector receives orders it has already shipped. Sage 300 does not report an error. It stops responding, with no message, no progress line and nothing in the log. Press Cancel to recover.

Refresh from the Excel Reader downwards, not from the middle. A run that starts at the reader produces a new set of orders, and every transform after it works.

Preparing to Generate the O/E Invoice

The next section prints the invoices to PDF. It needs two values the dataset does not yet carry: where to write each file and which report to use.

  1. Add another Map transform to the right of the shipment connector, join it and save.
  2. Open it, and on its Setup tab set Transform Id to INVOICEPREP.
  3. Press Field Mapping, leave Current Transaction Id on OE0692 and press Add twice:
  1. New Field Name
    • ExportPath
  2. Type
    • Text
  3. Evaluate
    • Ticked
  4. Evaluate String
    • "C:\IMan\OutputData\" & %INVNUMBER & ".pdf"

The Field Mapping dialog creating ExportPath, a Text field with Evaluate ticked and a formula joining the output folder, the invoice number and a pdf extension

  1. New Field Name
    • Form
  2. Type
    • Text
  3. Evaluate
    • Unticked
  4. Evaluate String
    • OEINV01.RPT

Use your own shared data directory if it differs

Replace the first part of the path with your own IMan shared data directory if it differs. C:\IMan\OutputData is the folder step 9 wrote the order status file to.

The INVOICEPREP field grid on OE0692 showing the four inherited shipment fields followed by ExportPath and Form

Press Refresh. ExportPath is evaluated, so each row now carries the full path for its invoice:

The INVOICEPREP preview showing each invoice number beside its evaluated ExportPath, a full path ending in the invoice number and .pdf

Press Close and save the integration. The branch now looks like this:

The completed branch: the Map, the Sage 300 shipment connector and the invoice preparation Map, running left to right below the order connector

Step 13.2: OE Invoice >