XML elements

Use 'XML Structure Section. Open Element' (CMS009) to define the XML elements. Use option 11='XML Structure. Open Section' in (CMS006) to open (CMS007). Use option 11='XML Structure. Open Section Elements' in (CMS007) to open (CMS009).

The elements are the lowest level in the XML structure and define the content to be included in the XML file. The content is either data from a field in an M3 Business Engine table, a calculated field, or a manually specified value.

The logic and functionality available in (CMS009) highly depends on the format selected in (CMS006).
Note: Section type 'Grp Sec' does not allow creation of element in (CMS009).

Common functionality used for all formats

  • Element type

    Elements with type 1 (Text element) contain the data, while Elements with type 2 and 3 are used to create sub-sections (define start and end elements).

  • Source of data

    Used when text elements are the source of data specifying where the data should be retrieved from. The most used source of data is 1-'Field', which is used when fetching data from tables or virtual fields.

    The source of data fields can also be used in customizing the 'Subject', 'Email Text', and 'Filename' fields in 'Output Media Selection. Open' (MNS205) and 'Doc Media Control Object. Connect Media' (CRS949). The field values are extracted from the Configurable XML file and then stored in predefined constants.

    This table shows the available predefined constants:

    Constants Description
    <CDTT> Current date and time
    <STDT> Current date including UTC information
    <CSTI> Current time including UTC information
    <USID> Current user ID
    <DIVI> Current division
    <PRTF> Current printer program
    <PGNM> Current start program
    <RLAY> (MNS210/B) report layout
    <RPLY> (CMS025/B) report layout
    <LITX> Report text in the start program
    <PFDS> (CMS005/E) printer file description
    <XMLT> (CMS006/E) variant
    <XMDS> (CMS004/B) description
    <DODV> Printer program division
  • Description

    Used as internal description in (CMS009), and never included in the XML file.

  • Element name

    The element name to be used in the XML file, which can only be changed for XML structures with format 3-'Open'. See below for standard used for formats 1 and 2.

  • Label

    Labels are included in the XML file. Attribute 'Label' (defined on the F panel) holds labels translated to the correct language (based on user, customer, or supplier).

    Note: For sections that are grouped (specified on CMS007/E), the attribute 'Label' is moved to the grouping section level, and is not defined per element on the F panel.

    These methods are used to decide how the label should be set:

    • Alternative 1 - No label is included.
    • Alternative 2 - The standard M3 message ID is used from the table were the field originates. Translation is taken from Message file MVXCON.
    • Alternative 3 - An overriding M3 message ID and message file can be specified. If no message file is specified, MVXCON is used.
    • Alternative 4 - An overriding text can be specified. Translation is specified by using the language button. The overriding text can be 1 – 15 characters long.

      A check box 'Fallback to standard msg' is used when language set for the printer file is not specified in the language button. If the check box is activated, 'Standard message ID' is used as a label in the XML for a field, section and variant. If the check box is not activated, XML label of a field, section or variant will be no label.

    • Alternative 5 - Text for the label is taken from another field. Normally used if the label is set dynamically by the output function, for example, Accounting dimension 1-7.
  • Column format

    Used to set the cell format in the Excel Output (CSV).

    You can set the column format using these alternatives:
    • Alternative 0 – None, cell format will always be set to 'General'.
    • Alternative 1 – According to field value, cell format will be set to 'Text' if data type of the field is 'String' (see (CMS009/E)). Otherwise, cell format will be set to 'General'.
    • Alternative 2 – Text, cell format will always be set to 'Text'.

    Even if 'Multiple Rows' is enabled on 'XML Structure. Open' (CMS006/E), it is always the first row that determines the cell format for the entire column.

    Note: This functionality only works if an Excel template is used, therefore a sheet name must be specified on 'XML Structure. Open' (CMS006/E) for single CSV and 'XML Structure. Open Section' (CMS007/E) for multiple CSV.
  • Debit/Credit code

    Indicates if Debit/Credit code information should be included in the XML file, and is only displayed for fields that have field information code equal to A01'-Currency' on 'Field Group. Display Permitted Field' (CRS109/E).

    If field Debit/Credit code is selected as an attribute, 'D-C' is included in the XML file. If the M3 BE table has a separate field for D/C code that is used otherwise, the D/C code is set based on the amount and setting on 'Settings – General Ledger' (CRS750/E). The prerequisite for the attribute to be included in the XML file is that Debit/Credit code functionality is active for the division on (CRS750/E).

  • Hide zero value

    Only displayed for fields with data type 5-Decimal.

    Numeric fields that are zero can be included in the XML file as 0,00 or as blank. If the field 'Hide zero value' is selected, then zero is included as blank, otherwise as 0,00.

  • Attributes (F panel)

    The F panel is used to define the Attributes for the elements. A maximum of seven attributes per element can be defined.

    Attributes 1 and 2 are reserved attributes and cannot be edited.

    • Attribute 1: Holds the value for the label (see above for details).
    • Attribute 2: Holds the value for Debit/Credit code (see above for details).

Format 1 - M3 standard document

Element sequence number

Used as the sequence of the element within a section in the XML file. The sequence number is divided into groups:

Element sequence Comments
0001-3999 Reserved for predefined elements in the standard XML structures delivered (M3_STD_0x-0x). You cannot add or delete elements in this group
4001-6998 Reserved for predefined elements in the standard XML structures delivered (M3_STD_0x-0x) where the table is unique for country configuration component. You cannot add or delete elements in this group
7001-9998 Elements can be added, changed, or deleted

Element name

If the source of data is set to 1-‘Field’ the element is set with these rules:

  • For database fields it is set equal to the 6-position database field name, for example, OAORNO or MMITNO.
  • For virtual fields is & replaced with VF, for example, VFCUCD or VFACAM
  • For other sources of data, the element name is set to ZZxxxx, where xxxx is the predefined suffix per source of data.

XML example

XML example with three elements

<UIIVNO Label="Invoice no">201401561</UIIVNO>

<VFORNO Label="CO no">1000025077</VFORNO>

<OAWHLO Label="Warehouse">110</OAWHLO>

Format 2 - M3 standard document

For M3 standard report format, elements are structured in row and column format. Every column must belong to a row. In (CMS009), Start and end elements indicate a row, and all elements between those start and end elements belong to that row.

  • Element sequence number

    Used to sequence the element in the XML file and decide what row the element belongs to.

    A range of sequence numbers is reserved for every row:

    Element sequence number Reserved
    0002-0999 Reserved for Row 1
    1002-1999 Reserved for Row 2
    8002-8999 Reserved for Row 9
  • Add or delete rows

    Adding rows is done with function key F21='Add Row' which creates a start and end element for the next free row. Deleting rows is done with function key F22='Delete row' which deletes the start element, the end element, and all the text elements between, for the row with the highest number.

  • Column number

    Used to indicate the column number for the field in a layout. Within a row, the number must be unique. Column number is part of the element name. Changing the column number automatically updates the element name.

  • Field length

    Used to indicate the space needed for the field in a layout. The default value is taken from the field length in the table.

  • Element name

    Set to 'Cx', where 'x' is the column number (see Column number above).

  • Additional label

    If a field needs an additional label, it is defined by specifying an M3 message ID and Message file. If no Message file is specified, 'MVXCON' is used. The additional label is then included in the XML file translated to the correct language (based on user, customer, or supplier).

  • Disable field on job run level

    Specific fields may need to be disabled, so as not to be included in the XML file for the entire job. For example, the field 'VAT code' should only be included if VAT is used.

    This is controlled by the parameter Run disabled. The decision if a field should be disabled is based on a virtual field from section type REPORT. If the virtual field is true (value 1), the field is considered to be disabled.

    Alternatives for parameter Run disabled:

    • 1 = No disable control
    • 2 = Disable control - field is still included in XML file but value is set to blank if disabled
    • 3 = Disable control and remove - field is removed from XML file if disabled

Format 3 - Open

For Open format, there is no additional functionality or other limitations.