Region Format – Formatting values according to language

In Business Central 23, Microsoft has introduced the Format Region field on the Customer, Vendor, and Document Header pages to enable formatting to be different from the user language.

 

ForNAV supports an easier way of doing this: In the Designer, setting the Format using report language property to True means that the ForNAV report will use the language that has been set to format values.

 

However, to support the Format Region field, ForNAV automatically detects if there is a field named Format Region on a data item record and then uses the value of the field to format field values in the report. This means that you can achieve the same functionality on older versions of Business Central/Nav simply by adding a Format Region field to tables.

 

You can also override or specify the Format Region field value in JavaScript using the CurrReport.FormatRegion field to set the formatting language. The value, based on RFC 4646, is languagecode2-country/regioncode2, where languagecode2 is the two-letter language code and country/regioncode2 is the two-letter subculture code. For example, ja-JP for Japanese (Japan) and en-US for English (United States). If a two-letter language code is not available, a three-letter code as defined in ISO 639-3 is used (for example, DEU,ENU,DAN, and so on).

 

If you set the CurrReport.FormatRegion field to null or leave it blank, ForNAV uses the default behavior for formatting.

 

ForNAV does not support setting the Format Region field in the Report request page. The reason for this is that the setting can be used to swap the month and day in the report output (for example, when choosing en-us instead of en-en) with the intention to tamper with dates to cover up non-compliant, after-the-fact invoicing.