Fields
Fields define the columns of a database table. Each field maps to a SQL column and determines the data type, size, and behaviour of data stored in that column. Every field inherits from an abstract base type (AxTableField) that provides common properties such as Label, HelpText, and ExtendedDataType. The concrete field type determines the SQL data type.
Base Field Types
| Type | SQL Type | Description |
|---|---|---|
| String | nvarchar | Variable-length Unicode text. Size controlled by StringSize (default 10, max 2^24 for memo). |
| Integer | int | 32-bit signed integer. Range: −2,147,483,648 to 2,147,483,647. |
| Int64 | bigint | 64-bit signed integer. Used for RecId references and large counters. |
| Real | numeric(p,s) | Fixed-point decimal. Scale controlled by the Scale property. |
| Date | date | Calendar date without time component. |
| Time | int | Time of day stored as seconds since midnight. |
| UtcDateTime | datetime2 | Date and time in UTC. The runtime converts to/from user time zones automatically. |
| Enum | int | Integer value backed by a base enumeration. Displayed as a dropdown on forms. |
| Container | varbinary(max) | Binary-serialised X++ container. Can hold mixed types. Not searchable or indexable. |
| Guid | uniqueidentifier | 128-bit globally unique identifier. |
Best Practices for Creating Fields
Always Use an Extended Data Type (EDT)
Every field should reference an EDT via the ExtendedDataType property rather than relying on the bare base type. EDTs centralise:
- Display formatting — string size, alignment, decimal places
- Labels and help text — consistent terminology across all forms and reports
- Relations — an EDT can carry a default relation, reducing duplication
- Validation — size limits and format masks defined once
When an EDT is assigned, the field inherits its label, help text, string size, and other properties automatically. Only override these at the field level when the field genuinely differs from the EDT default.
If no suitable EDT exists, create one. It is a Microsoft best practice that every field should have an EDT rather than using a raw base type.
Set Label and HelpText
Every user-facing field must have a Label (short name shown in column headers and form controls) and a HelpText (tooltip describing the field's purpose). If the field uses an EDT, these are inherited automatically. If you override them at the field level, ensure the override is intentional and accurate.
Naming Conventions
- Field names should be PascalCase with no underscores (e.g.,
AccountNum,TransDate,CurrencyCode). - Use the same name as the EDT where practical (e.g., a field using
CustAccountEDT should be namedCustAccount). - Boolean/flag fields should be named to read naturally:
IsActive,IsBlocked,AllowEdit.
Mandatory Fields
Set Mandatory to Yes only when the field truly requires a value. The runtime enforces this at the form level and raises an error if the user attempts to save without a value. Mandatory enforcement does not apply to direct X++ inserts — it is a form-level check only.
AllowEdit and AllowEditOnCreate
AllowEdit = Nomakes the field read-only on existing records (but still editable on new records).AllowEditOnCreate = Nomakes the field read-only even during record creation.- Both set to No creates a fully read-only field that can only be set in code.
Field Security and Authorization
AosAuthorization— when set to Yes, the field is protected by field-level security. Users must have explicit permission to read or write the field.MinReadAccess— when set to Auto, the field bypasses field-level security for read operations when accessed in certain framework scenarios (e.g., AutoLookup field groups).
Types Without Additional Properties
The following field types have no extra properties beyond the common set: Container, Date, Time, UtcDateTime, Guid. They are configured entirely through the common field properties and their associated EDT.
Properties
| Property | Display Name | Type | Description |
|---|---|---|---|
| Common (all fields) | |||
| Name | Name | String | The name of the element. |
| Label | Label | String | Descriptive label for the field, visible to users via Reporting tools. |
| HelpText | Help Text | String | Descriptive help text for the field, visible to users via Reporting tools. |
| GroupPrompt | Group Prompt | String | Prompt displayed when the field is part of a field group. |
| ExtendedDataType | Extended Data Type | String | Specify an EDT that corresponds to the data in this field. Enables richer formatting in Forms and Reports. |
| SaveContents | Save Contents | NoYes | Whether the field contents are saved to the database. Values: No (0), Yes (1). |
| Mandatory | Mandatory | NoYes | Whether the field must have a value. Values: No (0), Yes (1). |
| AllowEditOnCreate | Allow Edit On Create | NoYes | Whether the field can be edited when a record is being created. Values: No (0), Yes (1). |
| AllowEdit | Allow Edit | NoYes | Whether the field can be edited on existing records. Values: No (0), Yes (1). |
| Visible | Visible | NoYes | Whether this field is visible on forms and reports. Values: No (0), Yes (1). |
| AosAuthorization | AOS Authorization | NoYes | Whether field-level AOS authorization is enabled. Values: No (0), Yes (1). |
| MinReadAccess | Min Read Access | AutoNoYes | Determines whether the field can be auto-authorized for access. Values: No (0), Yes (1), Auto (99). |
| ConfigurationKey | Configuration Key | String | The configuration key assigned to the item. |
| AliasFor | Alias For | String | Select which field this is an alias for. |
| IgnoreEDTRelation | Ignore EDT Relation | NoYes | Whether the EDT relation for this field is considered. Values: No (0), Yes (1). |
| RelationContext | Relation Context | String | Relation context. |
| Null | Null | NoYes | Specifies that the column can accept NULL values. Values: No (0), Yes (1). |
| CountryRegionCodes | Country Region Codes | String | Comma-separated list of country/region codes where this field is shown. |
| CountryRegionContextField | Country Region Context Field | String | Specifies the field used to identify the country context. |
| IsSystemGenerated | Is System Generated | NoYes | Indicates whether the element was system-generated. Values: No (0), Yes (1). |
| IsManuallyUpdated | Is Manually Updated | NoYes | Indicates whether the element was manually updated. Values: No (0), Yes (1). |
| IsObsolete | Is Obsolete | NoYes | Determines whether the element is deprecated. Values: No (0), Yes (1). |
| GeneralDataProtectionRegulation | GDPR Classification | GeneralDataProtectionRegulation | Classifies the customer data for this field. Values: AccessControlData (0), CustomerContent (1), EndUserIdentifiableInformation_EUII (2), EndUserPseudonymousInformation_EUPI (3), SupportData (4), AccountData (5), PublicPersonalData (6), OrganizationIdentifiableInformation_OII (7), SystemMetadata (8), PublicNonPersonalData (9). |
| AssetClassification | Asset Classification | String | A classification value for tracking compliance. |
| FeatureClass | Feature Class | String | The concrete type implementing IFeature which determines the state of the feature assigned to this field. |
| SysSharingType | Single Data Sharing Type | SysSharingType | Determines if single data sharing is allowed for this field. Values: Always (0), Optional (1), Never (2). |
| String | |||
| StringSize | String Size | Int32 | Maximum number of characters allowed. Values exceeding this length are truncated. |
| Adjustment | Adjustment | Adjustment | Whether the field value should be left or right aligned when displayed. Values: Left (0), Right (1). |
| Enum | |||
| EnumType | Enum Type | String | The enumeration type to use for this field. Mutually exclusive with ExtendedDataType. |
| Integer | |||
| FieldUpdate | Field Update | FieldUpdate | Relative = Balance/Stock (fluctuating value). Absolute = Price/Plan (firm figure). Values: Absolute (0), Relative (1). |
| RelatedTable | Related Table | String | Name of the related table. |
| Int64 | |||
| FieldUpdate | Field Update | FieldUpdate | Relative = Balance/Stock (fluctuating value). Absolute = Price/Plan (firm figure). Values: Absolute (0), Relative (1). |
| Real | |||
| FieldUpdate | Field Update | FieldUpdate | Relative = Balance/Stock (fluctuating value). Absolute = Price/Plan (firm figure). Values: Absolute (0), Relative (1). |
| Scale | Scale | Int32 | Scale value for SQL numeric precision. |
| CurrencyCode | Currency Code | String | Determines the currency code used for this field during multi-company analysis. |
| CurrencyCodeTable | Currency Code Table | String | The table containing the currency code for this field. |
| CurrencyCodeField | Currency Code Field | String | The field containing the currency code for this field. |
| CurrencyDate | Currency Date | String | The date used to obtain the rate for translating the currency field. |
| CurrencyDateTable | Currency Date Table | String | The table containing the date used for currency translation. |
| CurrencyDateField | Currency Date Field | String | The field containing the date used for currency translation. |
| CorrectionFlagField | Correction Flag Field | String | Boolean field that indicates if the field value is a correction. |