Skip to content

Exporting Custom Data from Sage 200 (SDK)

This task will export data from Sage 200 in XML format, as specified by a table name and sets of columns, joins and where clauses. This is useful when there is no task which exports the data required.

The table and column names that can be used in the Query are determined by the Sage 200 database. They can be viewed using SQL Server Management Studio.

Note

The information below applies to version 3 of the task. Workflows created using Zynk 2026.10.4 or below will contain version 2 of this task, please see Exporting Custom Data from Sage 200 (SQL) instead.

Settings

Connection Settings

Sage 200 Connection

Required
The Sage 200 connection to use. See the Connecting to Sage 200 article if you require more information on how to create/manage connections.

Export Settings

Required

  • Date Created - Used when exporting new records. Only records created after this date will be exported. The date will update automatically each time the task runs.
  • Export Modified, New or All Records - Used to choose which records should be included in the export. Note that the 'Modified' setting will also export any new records.
  • Op Lock - Used when exporting modified records. Only records where the Op Lock is greater than this value will be exported. The value will update automatically each time the task runs.
    • When initially setting up the task, the Op Lock value will default to 0, this will export all records the first time that it runs.
    • If you would like the integration to pick up all records modified from now on, enter a value of MAX into the Op Lock setting and press Enter, Zynk will attempt to read the current highest value from Sage 200. Please note that you need to have a connection set up to the Sage 200 company on the task, and the user that Zynk is running as must be able to access the company).
  • Page Size - The maximum number of records in each batch read from Sage. Increasing this will speed up the export but use more memory. Defaults to 100.
  • Timeout (seconds) - Specify the timeout for the task you're running. Defaults to 30.
  • Use Caching - Will cache certain common types which could be referenced in multiple places, to minimise the amount of database activity, and decrease to overall export time. This will use more memory, if you encounter out of memory issues, then try disabling this setting.

Query Settings

Optional

  • Columns - Used to enter the column names to export from the Sage database. Be sure to include the table name (eg. [SLCustomerAccount].[CustomerAccountNumber])
  • Joins - Allows data to be exported from other tables in the Sage database. Required when exporting data from tables not included in the standard export.
  • Where Clauses - Allows filters to be set to limit the data that is exported.

Table

Required
The Sage 200 table to export from e.g. SLCustomerAccount. A row is exported for each record in this table, or for each combination of records when joining to tables with multiple matching records.

Truth Settings

Optional
These settings can be used to output the IDs of any records that were imported into Sage via Zynk, and an <Id> value was provided. The IDs are stored in the 'External ID' column of Zynk's truth table, and can be included in the export by specifying the following info:

  • Internal ID Column - The Sage database column name to read the internal ID value from. The column needs to be selected as part of the query. Some common examples of the column names to use for certain tables are listed below.

    • PLSupplierAccount - SupplierAccountNumber
    • POPOrderReturn - DocumentNo
    • SLCustomerAccount - CustomerAccountNumber
    • SOPOrderReturn - DocumentNo
    • StockItem - Code
    • In many other cases it is the table name followed by ID. For example, when exporting from the SOPDespatchReceipt table, it would be SOPDespatchReceiptID.
  • Record Type - The type of record to search for in the truth table. This can be seen on the Data tab. For example, for sales orders, the type is 'Zynk.Connect.Objects.SalesOrder'.

  • Collection - The collection to read the external ID value from. In most cases this can be left blank. For sales orders, this will need to be set to the type of order you are dealing with (either 'ProductInvoice', 'SopReturn', 'SopQuote' or 'SopProforma').

Output File

Required
The file to save the results of the query to. The data will be saved in XML format.

Export as Elements

Required
Set to True to export the data as XML elements, or False to export data as XML attributes.

Root

Required
The name to give the root element in the output XML file. Defaults to 'Rows'.

Row

Required
The name to give the XML element for each row returned by the SQL query. Defaults to 'Row'.

Zynk Settings

See Common Task Settings

Examples

The following query settings were used in the examples below:

  • Columns - SLCustomerAccount.SLCustomerAccountID AS Id, SLCustomerAccount.CustomerAccountNumber, SLCustomerContact.ContactName
  • Joins - Left join from SLCustomerAccount to SLCustomerContact using the SLCustomerAccountID columns.
  • Where Clauses - CustomerAccountNumber equals ZYNK0001.

Example output file when the 'Export as Elements' setting is set to False:

<?xml version="1.0" encoding="utf-8"?>
<Rows>
  <Row Id="1494" CustomerAccountNumber="ZYNK0001" ContactName="Mr. Joe Bloggs" />
  <Row Id="1494" CustomerAccountNumber="ZYNK0001" ContactName="Mr. John Smith" />
</Rows>

Example output file when the 'Export as Elements' setting is set to True:

<?xml version="1.0" encoding="utf-8"?>
<Rows>
  <Row>
    <Id>1494</Id>
    <CustomerAccountNumber>ZYNK0001</CustomerAccountNumber>
    <ContactName>Mr. Joe Bloggs</ContactName>
  </Row>
  <Row>
    <Id>1494</Id>
    <CustomerAccountNumber>ZYNK0001</CustomerAccountNumber>
    <ContactName>Mr. John Smith</ContactName>
  </Row>
</Rows>