How to export static values using template in Sage X3

By | October 10, 2022

As we know, Sage X3 provides special functionality to export/import data from/to X3 respectively. The import/export functionality is basically used to create or update transactions in X3. However, data export is the extraction and conversion of raw data from their existing format into a format required by another application. We export data either as a backup data or to move it between two different versions of programs. The export function in X3 is used to extract data from the database to ASCII type file (with fixed length or variable with separators), whose structure is described by an import/export template.

There may be a case where you need to export static or hard coded value for a particular field that is to be integrated in different application. If you want to set default value in the field from another application then instead of entering it manually, you can add the static value to template and export it. For example, if you want to identify the sales orders to be integrated into another application is from Sage X3 or not. Then in such cases, we can make use of static value functionality and you can easily achieve this using a template. Though there are columns as “Table name” and “Field” , we can achieve this by simply putting the hard coded value in double quotes in “Field” column.

Follow below steps for the same.

  • Navigate to: Setup > Usage > Imports/Exports > Import/Export templates
  • Select template to which static field is to be added.
  • Navigate to fields section and insert a line with table name. Here, in the “Field” column you can enter static value in double quotes. This value will be then exported for each record.
  • Below is an example where, we have added static value “X3 ORDER” as a field.

Refer below screen-shot for the same.

Now, whenever you will export any sales order transaction in X3, you will get “X3 ORDER” value exported at the defined position in template. Refer below example for better understanding.

  • Navigate to: Usage > Imports/Exports > Exports
  • Select template name ‘YSOH’ and enter transaction numbers to be exported.
  • Click on ‘OK’.

Refer below screen-shot for the same.

Export output:

Here, for both sales orders ‘SONAO0120024’ and ‘SONAO0120025’, customer order reference is exported as ‘X3 ORDER’.

Thus, you can export static/hard coded values using import/export template in Sage X3.