Skip to main content

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

TypeSQL TypeDescription
StringnvarcharVariable-length Unicode text. Size controlled by StringSize (default 10, max 2^24 for memo).
Integerint32-bit signed integer. Range: −2,147,483,648 to 2,147,483,647.
Int64bigint64-bit signed integer. Used for RecId references and large counters.
Realnumeric(p,s)Fixed-point decimal. Scale controlled by the Scale property.
DatedateCalendar date without time component.
TimeintTime of day stored as seconds since midnight.
UtcDateTimedatetime2Date and time in UTC. The runtime converts to/from user time zones automatically.
EnumintInteger value backed by a base enumeration. Displayed as a dropdown on forms.
Containervarbinary(max)Binary-serialised X++ container. Can hold mixed types. Not searchable or indexable.
Guiduniqueidentifier128-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.

tip

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 CustAccount EDT should be named CustAccount).
  • 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 = No makes the field read-only on existing records (but still editable on new records).
  • AllowEditOnCreate = No makes 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

41/41 properties
PropertyDisplay NameTypeDescription
Common (all fields)
NameNameStringThe name of the element.
LabelLabelStringDescriptive label for the field, visible to users via Reporting tools.
HelpTextHelp TextStringDescriptive help text for the field, visible to users via Reporting tools.
GroupPromptGroup PromptStringPrompt displayed when the field is part of a field group.
ExtendedDataTypeExtended Data TypeStringSpecify an EDT that corresponds to the data in this field. Enables richer formatting in Forms and Reports.
SaveContentsSave ContentsNoYesWhether the field contents are saved to the database. Values: No (0), Yes (1).
MandatoryMandatoryNoYesWhether the field must have a value. Values: No (0), Yes (1).
AllowEditOnCreateAllow Edit On CreateNoYesWhether the field can be edited when a record is being created. Values: No (0), Yes (1).
AllowEditAllow EditNoYesWhether the field can be edited on existing records. Values: No (0), Yes (1).
VisibleVisibleNoYesWhether this field is visible on forms and reports. Values: No (0), Yes (1).
AosAuthorizationAOS AuthorizationNoYesWhether field-level AOS authorization is enabled. Values: No (0), Yes (1).
MinReadAccessMin Read AccessAutoNoYesDetermines whether the field can be auto-authorized for access. Values: No (0), Yes (1), Auto (99).
ConfigurationKeyConfiguration KeyStringThe configuration key assigned to the item.
AliasForAlias ForStringSelect which field this is an alias for.
IgnoreEDTRelationIgnore EDT RelationNoYesWhether the EDT relation for this field is considered. Values: No (0), Yes (1).
RelationContextRelation ContextStringRelation context.
NullNullNoYesSpecifies that the column can accept NULL values. Values: No (0), Yes (1).
CountryRegionCodesCountry Region CodesStringComma-separated list of country/region codes where this field is shown.
CountryRegionContextFieldCountry Region Context FieldStringSpecifies the field used to identify the country context.
IsSystemGeneratedIs System GeneratedNoYesIndicates whether the element was system-generated. Values: No (0), Yes (1).
IsManuallyUpdatedIs Manually UpdatedNoYesIndicates whether the element was manually updated. Values: No (0), Yes (1).
IsObsoleteIs ObsoleteNoYesDetermines whether the element is deprecated. Values: No (0), Yes (1).
GeneralDataProtectionRegulationGDPR ClassificationGeneralDataProtectionRegulationClassifies 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).
AssetClassificationAsset ClassificationStringA classification value for tracking compliance.
FeatureClassFeature ClassStringThe concrete type implementing IFeature which determines the state of the feature assigned to this field.
SysSharingTypeSingle Data Sharing TypeSysSharingTypeDetermines if single data sharing is allowed for this field. Values: Always (0), Optional (1), Never (2).
String
StringSizeString SizeInt32Maximum number of characters allowed. Values exceeding this length are truncated.
AdjustmentAdjustmentAdjustmentWhether the field value should be left or right aligned when displayed. Values: Left (0), Right (1).
Enum
EnumTypeEnum TypeStringThe enumeration type to use for this field. Mutually exclusive with ExtendedDataType.
Integer
FieldUpdateField UpdateFieldUpdateRelative = Balance/Stock (fluctuating value). Absolute = Price/Plan (firm figure). Values: Absolute (0), Relative (1).
RelatedTableRelated TableStringName of the related table.
Int64
FieldUpdateField UpdateFieldUpdateRelative = Balance/Stock (fluctuating value). Absolute = Price/Plan (firm figure). Values: Absolute (0), Relative (1).
Real
FieldUpdateField UpdateFieldUpdateRelative = Balance/Stock (fluctuating value). Absolute = Price/Plan (firm figure). Values: Absolute (0), Relative (1).
ScaleScaleInt32Scale value for SQL numeric precision.
CurrencyCodeCurrency CodeStringDetermines the currency code used for this field during multi-company analysis.
CurrencyCodeTableCurrency Code TableStringThe table containing the currency code for this field.
CurrencyCodeFieldCurrency Code FieldStringThe field containing the currency code for this field.
CurrencyDateCurrency DateStringThe date used to obtain the rate for translating the currency field.
CurrencyDateTableCurrency Date TableStringThe table containing the date used for currency translation.
CurrencyDateFieldCurrency Date FieldStringThe field containing the date used for currency translation.
CorrectionFlagFieldCorrection Flag FieldStringBoolean field that indicates if the field value is a correction.