Acumatica Reader - Haufe-Lexware/haufe.no-frills-transformation GitHub Wiki

Read content from an Acumatica template/snapshot XML file

The Acumatica Reader plugin enables reading Acumatica XML export files as data sources in No Frills Transformation. It reads the proprietary XML format used by Acumatica ERP for table data export.

It can be used for database template manipulation, or to further work with data from Acumatica snapshots.

URI Format

The Acumatica Reader recognizes the following URI formats:

  • acumatica.xml://<filepath> - Read an Acumatica XML file

Acumatica XML File Format

Acumatica exports table data in a specific XML format:

<?xml version="1.0" encoding="utf-8"?>
<data>
    <table name="TableName">
        <col name="ColumnName1" type="DataType1" default="DefaultValue1" />
        <col name="ColumnName2" type="DataType2" nullable="true" />
        <col name="ColumnName3" type="DataType3" />
        <!-- ... more column definitions ... -->
    </table>
    <rows>
        <row Column1="value1" Column2="value2" Column3="value3" />
        <row Column1="value4" Column2="value5" Column3="value6">
            <column name="LargeField"><![CDATA[Large text content...]]></column>
        </row>
        <!-- ... more rows ... -->
    </rows>
</data>

File Structure

Table Metadata Section

The <table> element defines the schema:

  • name attribute: The table name
  • col elements: Column definitions with:
    • name: Column name
    • type: Data type (e.g., Int, Char(32), NVarChar(MAX), DateTime, Bit)
    • nullable: Whether the column can be null (optional)
    • default: Default value name (optional)
    • raw-default: Raw default value (optional)
    • identity: Identity specification (optional)

Data Section

The <rows> element contains the actual data:

  • row elements: Each row represents one record
    • Simple values are stored as XML attributes
    • Large values (or values containing special characters) are stored in nested <column> elements with CDATA sections

Field Handling

  • Field names are read from the <col> elements in the <table> section
  • Field values are read from row attributes or nested <column> elements
  • Large text fields (>1000 characters) are typically stored in <column> elements with CDATA sections
  • Missing attributes return empty strings
  • All values are converted to strings regardless of the declared type

Example Configuration

<Source>acumatica.xml://localization_values.xml</Source>

Example Input File: localization_values.xml

<?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="CreatedByID" type="UniqueIdentifier" />
        <col name="CreatedDateTime" type="DateTime" />
        <col name="tstamp" type="Timestamp" />
    </table>
    <rows>
        <row Id="0001E8CACD459989BA90C5BB548CC2CB" 
             NeutralValue="Packaging Type -&gt; Auto and Manual" 
             IsNotLocalized="0" 
             IsSite="1" 
             TranslationCount="1" 
             CreatedByID="b5344897-037e-4d58-b5c3-1bdfd0f47bf9" 
             CreatedDateTime="2019-04-02 11:21:17.997" />
        <row Id="000289BE413833AFDB0215223ACFC75C" 
             IsNotLocalized="0" 
             IsSite="1" 
             TranslationCount="3" 
             CreatedByID="b5344897-037e-4d58-b5c3-1bdfd0f47bf9" 
             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>

Resulting Fields

  • CompanyID
  • Id
  • NeutralValue
  • IsNotLocalized
  • IsSite
  • TranslationCount
  • CreatedByID
  • CreatedDateTime
  • tstamp

Sample Records

Record 1:

  • Id = "0001E8CACD459989BA90C5BB548CC2CB"
  • NeutralValue = "Packaging Type -> Auto and Manual"
  • IsNotLocalized = "0"
  • IsSite = "1"
  • TranslationCount = "1"
  • CreatedByID = "b5344897-037e-4d58-b5c3-1bdfd0f47bf9"
  • CreatedDateTime = "2019-04-02 11:21:17.997"
  • CompanyID = "" (empty - not in row)
  • tstamp = "" (empty - not in row)

Record 2:

  • Id = "000289BE413833AFDB0215223ACFC75C"
  • NeutralValue = "A Boolean value that indicates whether users can archive the cost roll results without updating the pending costs." (from CDATA)
  • IsNotLocalized = "0"
  • IsSite = "1"
  • TranslationCount = "3"
  • CreatedByID = "b5344897-037e-4d58-b5c3-1bdfd0f47bf9"
  • CreatedDateTime = "2024-10-11 08:27:27.847"
  • CompanyID = "" (empty - not in row)
  • tstamp = "" (empty - not in row)

Special Handling

CDATA Sections

Large text content is automatically read from <column> elements with CDATA sections:

<row Id="123">
    <column name="Description"><![CDATA[
        This is a very long text that may contain
        special characters like <, >, &, quotes, etc.
    ]]></column>
</row>

XML Entity Encoding

XML entities in attribute values are automatically decoded:

  • &lt;<
  • &gt;>
  • &amp;&
  • &quot;"
  • &apos;'

Limitations

  • The reader expects exactly one <table> element in the XML file
  • The reader expects exactly one <rows> element in the XML file
  • All field names must be defined in the <table> section
  • The entire file structure is loaded sequentially; random access is not supported
  • Field types from the schema are ignored; all values are treated as strings
  • The Query() method is not implemented

See Also

⚠️ **GitHub.com Fallback** ⚠️