-
Notifications
You must be signed in to change notification settings - Fork 1
Acumatica Writer
The Acumatica Writer plugin enables writing transformation results to Acumatica XML import files. It generates the proprietary XML format used by Acumatica ERP for table data import.
The Acumatica Writer recognizes the following URI formats:
-
acumatica.xml://<filepath>- Write to an Acumatica XML file
The Acumatica Writer requires a configuration file that defines the table schema and sorting options. The configuration file path is specified in the config attribute of the <Target> element.
<config>
<table name="TableName" status="optional_status">
<col name="ColumnName1" type="DataType1" default="DefaultValue1" />
<col name="ColumnName2" type="DataType2" nullable="true" />
<col name="ColumnName3" type="DataType3" />
<!-- ... more column definitions ... -->
</table>
<sort>
<field>SortField1</field>
<field>SortField2</field>
<!-- ... more sort fields ... -->
</sort>
</config>-
name: Table name (supports parameter substitution with
%parameter%) - status: Optional status attribute for the table
- name: Column name (must match a field in your transformation)
-
type: Data type (e.g.,
Int,Char(32),NVarChar(MAX),DateTime,Bit) - nullable: Set to "true" if the column can be null (optional)
- default: Default value name (optional)
- raw-default: Raw default value (optional)
- identity: Identity specification (optional)
Defines the order in which records are written to the output file. Records are sorted by the specified fields in order.
The Acumatica Writer generates XML in this format:
<?xml version="1.0" encoding="utf-8"?>
<data>
<table name="TableName">
<col name="Column1" type="Type1" />
<col name="Column2" type="Type2" nullable="true" />
<!-- ... column definitions from config ... -->
</table>
<rows>
<row Column1="value1" Column2="value2" />
<row Column1="value3" Column2="value4">
<column name="LargeField"><![CDATA[Large content...]]></column>
</row>
<!-- ... more rows ... -->
</rows>
</data>- Short values (≤1000 characters): Written as XML attributes
-
Long values (>1000 characters): Written in nested
<column>elements with CDATA sections - Exception: Fields named "Data" are always written as attributes, even if long
-
Exception: Values containing
]]>are always written as attributes to avoid CDATA conflicts
Fields marked as nullable="true" in the configuration:
- Empty values: Omitted from the output (no attribute written)
- Non-empty values: Written normally
Three fields have special handling and are always omitted when empty:
CompanyIDCompanyMasktstamp
All tab characters (\t) in field values are automatically encoded as 	 (except in CDATA sections), as required by Acumatica.
The Acumatica Writer always uses Windows-style line endings (CR+LF / \r\n), regardless of the operating system, ensuring compatibility with Acumatica ERP.
Records are sorted in memory before being written to the output file. The sort order is determined by the <sort> section in the configuration file:
- Records are compared field by field in the order specified
- If a sort field is not found in the field list, it is ignored
- If no sort fields are configured, records are written in the order they were received
<Transformation>
<Source config="delim=';'">file://some-file.csv</Source>
<Target config="acumatica_config.xml">acumatica.xml://output.xml"</Target>
<Fields>
<Field name="Id">$Id</Field>
<Field name="NeutralValue">$Value</Field>
<Field name="IsNotLocalized">$NotLocalized</Field>
<Field name="IsSite">$Site</Field>
<Field name="CreatedDateTime">$Created</Field>
</Fields>
</Transformation><config>
<table name="LocalizationValue">
<col name="CompanyID" type="Int" default="Zero" />
<col name="Id" type="Char(32)" />
<col name="NeutralValue" type="NVarChar(MAX)" />
<col name="IsNotLocalized" type="Bit" />
<col name="IsSite" type="Bit" raw-default="1" />
<col name="TranslationCount" type="Int" />
<col name="CreatedDateTime" type="DateTime" />
<col name="tstamp" type="Timestamp" />
</table>
<sort>
<field>Id</field>
</sort>
</config><?xml version="1.0" encoding="utf-8"?>
<data>
<table name="LocalizationValue">
<col name="CompanyID" type="Int" default="Zero" />
<col name="Id" type="Char(32)" />
<col name="NeutralValue" type="NVarChar(MAX)" />
<col name="IsNotLocalized" type="Bit" />
<col name="IsSite" type="Bit" raw-default="1" />
<col name="TranslationCount" type="Int" />
<col name="CreatedDateTime" type="DateTime" />
<col name="tstamp" type="Timestamp" />
</table>
<rows>
<row Id="0001E8CACD459989BA90C5BB548CC2CB" NeutralValue="Packaging Type -> Auto and Manual" IsNotLocalized="0" IsSite="1" CreatedDateTime="2019-04-02 11:21:17.997" />
<row Id="000289BE413833AFDB0215223ACFC75C" IsNotLocalized="0" IsSite="1" CreatedDateTime="2024-10-11 08:27:27.847">
<column name="NeutralValue"><![CDATA[A Boolean value that indicates whether users can archive the cost roll results without updating the pending costs.]]></column>
</row>
</rows>
</data>Note:
- Empty fields (
CompanyID,TranslationCount,tstamp) are omitted - Short values are written as attributes
- Long values (>1000 chars) are written in CDATA sections
- Records are sorted by
Idfield - XML entities are encoded (
>becomes>) - Tab indentation is used (one tab per level)
After writing the XML, the writer performs post-processing:
- Tabs in content (not indentation) are encoded as
	 - CDATA sections are preserved without tab encoding
- The temporary file is replaced with the final output file
- All records are kept in memory until
FinishWrite()is called - Large datasets may cause memory issues
- All values are written as strings; no type conversion is performed
- Arrays or complex nested structures are not supported
- Field names must match those defined in the configuration file
- The configuration file must be valid XML matching the
AcumaticaEntityConfigschema