Sets a value that determines how data is formatted, together with the C/AL expression in the AutoFormatExpr Property.

Applies To

  • Table Fields
  • Page Fields
  • Report columns

Remarks

These two properties are only used to format amounts that can be stated in a foreign currency. When you use the AutoFormatType and AutoFormatExpr properties to format a field, a trigger called AutoFormatTranslate in codeunit 1 is called. AutoFormatTranslate has ID 12 and takes two parameters; one from the AutoFormatType property and one from the AutoFormatExpr property. The AutoFormatType property contains an integer (0, 1, or 2) and the AutoFormatExpr property contains text (“ =LCY”).

These properties are used when you have an amount or a unit amount that you want to be able to display in another currency and these properties determine the number of decimals that will be displayed. For example, a sales order will use two decimals when the currency is defined as US dollar and 0 decimals when the currency is defined as IDR (Indonesian rupiah).

The settings for the AutoFormatType property and the AutoFormatExpr property depend on the type of data in the field that you need to format. There are three categories of data: amount, unit amount, and other types of data.

  • Amount - AutoFormatType must be 1 and AutoFormatExpr must return a currency code (the blank currency code denotes LCY) in order for data to be formatted as amount data.
  • Unit Amount - AutoFormatType must be 2 and AutoFormatExpr must return a currency code (the blank currency code denotes LCY) in order for data to be formatted as unit amount data.
  • Other - AutoFormatType must be 0 and AutoFormatExpr must be blank for the data to be formatted using the default settings (Standard Format 0).

If the AutoFormatType property does not contain a value, the format specified in the DecimalPlaces Property will determine how the decimal is formatted in the table, report, or page. If you enter a value in the AutoFormatType property, it will override the value specified in the DecimalPlaces property and the AutoFormatType property will determine how the decimal is formatted in the table, report, or page. Furthermore, if you enter a value in the AutoFormatType property for a report or page, it will override the value entered in the DecimalPlaces property in the table and determine how the decimal is formatted in the report or page.

See Also