Table Field Properties

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

The following table describes properties for table fields. For guidelines about how to set property values, see Best Practices for Table Field Properties.

The following properties are related to report models that are used to add information to a report.

  • AnalysisDefaultTotal

  • AnalysisLabel

  • AnalysisTotaling

  • AnalysisUsage

  • AnalysisVisibility

  • CurrencyCode

  • CurrencyCodeField

  • CurrencyCodeTable

Property

Description

New in this version of
 Microsoft Dynamics AX

Adjustment

Determines whether the string field should be left or right aligned when it is stored in the database. For example, if the 11 character string "hello world" is stored in a right aligned field that has a StringSize setting of 40, then 29 space characters are stored as the prefix.

Note

The Adjustment setting affects the search result when you search for a value in a table using the relational operators >, <, >=, or <=. It does not affect ==.

The Adjustment setting is ignored when the StringSize is (Memo).

AliasFor

Determines the table field for which the field is an alias.

AllowEdit

Determines whether users are allowed to modify data in an existing record in a form.

AllowEditOnCreate

Determines whether users are allowed to enter data in the field when a new record is created from a form.

AnalysisDefaultTotal

For report models, it specifies the method for aggregating field data when an automatic total for the table is displayed in a report built by using Microsoft SQL Server Reporting Services and report models. The default value is No, which indicates that the field is not automatically shown as a total.

For OLAP cubes, it specifies the aggregate function for a measure. Use this property when AnalysisUsage is set to Measure. You can specify one of the following values.

  • Sum - Returns the sum of all the values in a set.

  • Count - Returns the number of non-null items in a set.

  • CountDistinct - Returns the number of distinct non-null items in a set.

  • Min - Returns the minimum value in a set.

  • Max - Returns the maximum value in a set.

  • None - No aggregate function is applied.

  • Auto - Applies to derived extended data types. The value of the AnalysisUsage property for the parent extended data type is to be used.

AnalysisLabel

Specifies the label to use as a caption in a SQL Server Analysis Services (SSAS) cube for the table field. The label is applied to either a dimension attribute or a measure.

This property is intended for use when either of the following are true:

  • The Label property is not defined.

  • The Label property does not work as a caption for a dimension attribute or a measure in a SSAS cube.

AnalysisUsage

Identifies the role of the field in a cube. You can specify one of the following values.

  • Attribute - The field is a dimension attribute.

  • Measure - The field is a measure.

  • Both - The field is both a dimension attribute and a measure.

  • None - The field is not a dimension attribute and not a measure.

  • Auto - The value of the AnalysisUsage property for the extended data type or enumeration that the field is based on is to be used.

ConfigurationKey

Sets the configuration key for the field.

CountryRegionCodes

Specifies the country region code(s) where the table field is applicable or valid. The client framework and application may make use of this property to enable or disable country or region specific features. This is implemented as a comma-separated list of ISO country codes in a single string. The values must match data contained in the global address book.

AX 2012

CountryRegionContextField

Specifies the field that will be used to identify the country context. See CountryRegionCodes.

AX 2012

ExtendedDataType

Determines the extended data type to be used for this field.

GroupPrompt

Specifies a label for the field when it appears in a group.

Tip

You can use this property to ensure that a field label does not repeat text that appears in a field group label. For example, if a field group on a form is labeled Customer, do not include this text in the GroupPrompt property for fields that are included in the group.

HelpText

Specifies the help string for the field. The help string is displayed when the field is used in a form.

ID

Specifies the field ID generated by the system.

IgnoreEDTRelation

Used in EDT (Extended Data Type) relation migration.

When migrating relations from an EDT node to a table node, you may skip an invalid relation for a given table field. To do so, set the IgnoreEDTRelation property of the field to Yes. The default value is No.

AX 2012

Label

Specifies a label for the field. This will appear in forms and reports. See also AnalysisLabel (in a previous row).

Mandatory

Indicates whether a user must add data to a field in a form. Set Mandatory to Yes to indicate that the default or initialization value for each data type is not acceptable for persistence into the database. The following list shows some default values that cannot be used for Mandatory fields on a form:

  • Empty is not acceptable for a str (string) field.

  • The minimum date-time is not acceptable for date-time fields such as date and utcdatetime.

  • 0 is not acceptable for numeric fields such as int, real, and enum.

Microsoft Dynamics AX does not support the semantics for the null value that is standard in most SQL database products. All fields are not nullable in the database that underlies Microsoft Dynamics AX. Therefore the Mandatory property does not involve anything having to do with the concept of null.

Warning

A mandatory table field can have its EnumType property set to an enum. You might define a field as an enum type that includes an item that has the integer value 0. In such a case, the 0 item is not available to select in the form.

The forms system automatically calls the validateWrite method to enforce the setting of the Mandatory property.

However, the Mandatory property has no effect on the behavior of direct X++ SQL that inserts or updates the value of a table field. In your direct X++ SQL you have the option to include calls to the validateWrite method on your table buffer variable. Your buffer variable inherits the method from the xRecord class.

MinReadAccess

Specifies the mode of the auto-authorization feature.

Auto-authorization has 2 modes of operation: surrogate foreign key and lookup.

If a table in a query is tagged for surrogate foreign key authorization, and the user does not have access to that table and has not explicitly been denied, then view access is granted to the table.

However, not all fields are visible; the visibility is determined by the following rules:

  • If minReadAccess is No, then no access will be granted to the field.

  • Else if minReadAccess is Yes, then view access will be granted to the field.

  • Otherwise, view access will be granted if it is part of the natural key auto identification group, if it is a title field, or if it is a system field.

If a table in a query is tagged for lookup authorization, access is determined by the following rules:

  • If MinReadAccess is No, then no access will be granted to the field.

  • Otherwise, view access will be granted to the field.

AX 2012

Model

Specifies which model the table field is in.

A model is a logical grouping of elements in a layer. An element can exist in exactly one model in a layer. Examples of elements are a table or class. The same element can exist in a customized version in a model in a higher layer.

AX 2012

Name

Specifies the name of the field.

RelationContext

Specifies the mapping of a field to a specific table relation.

This is typically used for unit-of-measure scenarios to model data related to currency codes or quantities. The relation associated with this field can then be used to show a lookup of currency codes or quantities.

There is no default.

AX 2012

SaveContents

Determines whether the field data is saved in the database or is treated as virtual field data. Virtual field data is calculated at run time when the field is displayed, and has no physical representation in the database.

Tip

Instead of virtual fields, you can use display and edit methods.

 StringSize

Sets the field length, in number of characters.

The maximum field length is database-dependent. The (Memo) value indicates that the field is unlimited in length.

Type

Specifies the base type of a field.

Visible

Determines whether the field should be visible in the user interface.

See also

How to: Create Tables

Primitive Data Types

Table Properties