Business Integration Solutions Documentation

File name formats

When setting up a File Writer or an Azure File Writer you also need to specify the name of the file that will be created. The assist edit on the file name field will open a list of predefined macros that can be used in naming the file. These macros are replaced at run time with actual values.

Token Description
$(MessageNumber) A unique message number linked to the message
$(Month) Current month
$(DayOfMonth) Day ordinal of the current month
$(Year) Current year
$(Hours) Current hour
$(Minutes) Current minute
$(TableField(<FieldName>)) Table field value from the incoming record
$(FullOriginalFileName) Original file name including the extension
$(OriginalFilename) Original file name excluding the extension
$(OriginalFilenameExtension) Original file name extension. This does not include the dot (e.g. xml not .xml)

TableField(<FieldName>)

The filename formats page, gives you the option to include field values from the incoming record. <FieldName> must be replaced with the actual fieldname in the table without affixes (no brackets, signs, quotes or other delimiters)

Scenario:

Record:

Table: Sales Header

    Fields: Document Type, No., Sell-To Customer Name

Connection:

    Timer Event > XmlGenerator > Splitter > Azure File Writer with filename set to "Order_$(TableField(<FieldName>)).xml"

If we set the filename to Order_$(TableField(No.)).xml", the sales order number will be part of the filename, e.g. Order_SO01234.xml.

FileNameFormats

Solution center setup

If a macro can't be translated at run time, then the default value will be applied (for reference see the Value column in the screenshot above). This format clashes with Azure Storage filename restrictions.

To prevent failing messages due to the presence of curly brackets, a new flag is introduced in Solution Center Setup called "Macros with parentheses" which if enabled will make macros use parentheses '()' instead of curly brackets ''. This is a global setting

SCSetup