Skip to main content

Extended Data Types

An Extended Data Type (EDT) is an AOT object that extends one of the system's primitive data types (string, integer, real, date, etc.) with additional metadata: labels, help text, string sizes, formatting rules, and relations. EDTs are the standard mechanism for defining reusable, semantically meaningful data types across the entire application.

Every table field, form control, method parameter, and variable in D365 F&O should reference an EDT rather than a raw primitive type. This ensures consistent labels, validation, formatting, and lookup behaviour wherever the same concept appears.


Primitive Data Types

D365 F&O provides the following primitive (base) data types. Each EDT must ultimately derive from one of these:

Primitive TypeX++ TypeSQL TypeDescription
Stringstrnvarchar(n)Variable-length Unicode text. Size controlled by StringSize.
Integerintint32-bit signed integer.
Int64int64bigint64-bit signed integer. Used for RecId and large counters.
Realrealnumeric(p,s)Fixed-point decimal. Scale controlled by Scale and NoOfDecimals.
DatedatedateCalendar date without time component.
TimetimeOfDayintTime of day stored as seconds since midnight (0–86399).
UtcDateTimeutcdatetimedatetime2Date and time in UTC. The runtime converts to/from user time zones.
EnumenumintInteger value backed by a base enumeration.
Containercontainervarbinary(max)Binary-serialised X++ container. Not searchable or indexable.
Guidguiduniqueidentifier128-bit globally unique identifier.

EDT Inheritance

One of the most important features of EDTs is inheritance. An EDT can extend another EDT using the Extends property, forming a parent–child chain. The child EDT inherits all properties from its parent and can override any of them.

How Inheritance Works

  • When you set the Extends property on an EDT to the name of another EDT, the child inherits all of the parent's settings: label, help text, string size, relations, formatting, and display properties.
  • The child can override any inherited property by setting it explicitly. Properties left at their default inherit from the parent at runtime.
  • Inheritance chains can be multiple levels deep (e.g., AccountNumCustAccountCustVendAccount).
  • The base type (string, int, real, etc.) is determined by the root EDT in the chain and cannot be changed by child EDTs.

See Code Examples for inheritance patterns in X++.

EDT Inheritance Hierarchies — type safety and property inheritance

EnforceHierarchy

The EnforceHierarchy property controls whether the compiler enforces type safety across the EDT inheritance hierarchy:

  • EnforceHierarchy = Yes — assignments and comparisons between EDTs must respect the hierarchy. You cannot assign a VendAccount to a CustAccount variable even though both extend AccountNum, because they are sibling types.
  • EnforceHierarchy = No (default) — the compiler treats all EDTs of the same primitive base type as interchangeable (legacy behaviour).
tip

Microsoft best practice: set EnforceHierarchy = Yes on new EDT hierarchies. This catches type-mismatch bugs at compile time rather than producing silent data errors at runtime.


Creating an EDT

To create a new EDT in Visual Studio:

  1. Right-click your project → AddNew ItemEDT String (or EDT Integer, EDT Real, etc.).
  2. Set the Name property (PascalCase, e.g., CustAccount, TransDate, AmountMST).
  3. Set Label and HelpText using label IDs for translation support.
  4. Optionally set Extends to inherit from an existing EDT.
  5. Set type-specific properties (e.g., StringSize for strings, NoOfDecimals for reals).
  6. Add Relations or set ReferenceTable if the EDT should carry a default foreign-key relationship.

See Code Examples for variable declaration and method signature patterns.


Properties

The property table below shows all properties available on an EDT. The base properties (from AxEdt) are common to all EDT types. Type-specific properties are shown in separate colour-coded sections for each primitive type that adds its own properties.

59/59 properties
PropertyDisplay NameTypeDescription
Common (all EDTs)
NameNameStringThe name of the element.
LabelLabelStringDescriptive label visible to users on forms, reports, and Reporting tools.
HelpTextHelp TextStringDescriptive help text for the field, visible to users browsing the model via Reporting tools.
ExtendsExtendsStringThe parent EDT this type inherits from. All properties are inherited and can be overridden.
CollectionLabelCollection LabelStringLabel used when the plural name of an item stored with this type is needed.
ConfigurationKeyConfiguration KeyStringThe configuration key assigned to the item. Controls visibility based on licence configuration.
ReferenceTableReference TableStringThe table referenced by this EDT. Indicates the primary key table which this EDT references.
FormHelpForm HelpStringThe form to use when a lookup is performed from a field using this EDT.
DisplayLengthDisplay LengthInt32Length of the display field, in number of characters.
ButtonImageButton ImageButtonImageAlternative lookup button icon. Values: Arrow (0), Mail (1), URL (2), ThreeDots (3), OpenFile (4), Calendar (5), Phone (6), RightArrow (7).
AlignmentAlignmentAlignment_ITxtText alignment in the control. Values: Auto (0), Left (1), Right (2), Center (3).
DirectionDirectionDirectionDirectional flow of characters when rendered. Values: Auto (0), LTR (1), RTL (2).
ControlClassControl ClassStringThe control class to use when a field using this EDT is added to a form.
PresenceIndicatorAllowedPresence Indicator AllowedNoYesWhether the system should attempt to display a presence indicator. Values: No (0), Yes (1).
PresenceClassPresence ClassStringX++ class used with PresenceMethod to return a PresenceInfo object instance.
PresenceMethodPresence MethodStringStatic method in PresenceClass called with the control's data value.
DataInteractorFactoryDataInteractorFactory ClassStringX++ class extending DataInteractorFactory for contextual data entry, lookups, and validation.
EnforceHierarchyEnforce HierarchyNoYesWhether assignments and comparisons must respect the EDT hierarchy. Values: No (0), Yes (1).
LiteralsLiteralsSqlLiteralMode_ITxtHow literals are represented in SQL statements. Values: Default (0), ForceLiterals (1), ForcePlaceholders (2).
CountryRegionCodesCountry Region CodesStringComma-separated list of country/region codes where this EDT is shown.
IsObsoleteIs ObsoleteNoYesWhether the element is deprecated. Values: No (0), Yes (1).
VisibilityVisibilityCompilerVisibilityCompiler visibility level. Values: Private (0), Protected (1), Public (2), Internal (3), InternalProtected (4).
TagsTagsStringTags for this element, separated by semicolons.
String
StringSizeString SizeInt32Maximum number of characters allowed.
DatabaseStringSizeDatabase String SizeInt32Maximum size of the string in the database. Can be larger than StringSize to allow extension in child EDTs.
StringSizeIsExtensibleString Size is ExtensibleAutoNoYesWhether the string size property is extensible on this EDT and child EDTs. Values: No (0), Yes (1), Auto (99).
DisplayHeightDisplay HeightInt32Fixed height value. For input controls, use with MultiLine to indicate a multi-line input.
AdjustmentAdjustmentAdjustmentWhether characters in fixed-length strings are stored on the left or right of the padding spaces. Values: Left (0), Right (1).
ChangeCaseChange CaseChangeCaseWhether the system enforces the case of entered text. Values: Auto (0), None (1), UpperCase (2), LowerCase (3), SentenceCase (4).
Integer / Int64
AllowNegativeAllow NegativeAutoNoYesWhether the control supports negative numbers. Values: No (0), Yes (1), Auto (99).
SignDisplaySign DisplaySignDisplayHow the negative sign is displayed. Values: None (1), Prefixed (2), Suffixed (3), Parentheses (4), Auto (99).
ShowZeroShow ZeroAutoNoYesWhether a numeric control shows zero or an empty field. Values: No (0), Yes (1), Auto (99).
RotateSignRotate SignAutoNoYesWhether the value is negated for display (e.g., changes − to + and vice versa). Values: No (0), Yes (1), Auto (99).
DisplaceNegativeDisplace NegativeInt32Number of characters a negative number should indent to the right.
Real
NoOfDecimalsNo Of DecimalsInt32Number of decimal places stored and displayed for this data type.
NoOfDecimalsIsExtensibleNo Of Decimals is ExtensibleBooleanWhether the number of decimals supports extension.
ScaleScaleInt32Scale value for SQL numeric precision.
DecimalSeparatorDecimal SeparatorDecimalSeparatorDecimal separator character. Values: Dot (1), Comma (2), Auto (99).
ThousandSeparatorThousand SeparatorThousandSeparatorThousands separator character. Values: None (0), Dot (1), Comma (2), Apostrophe (3), Space (4), Auto (99).
AllowNegativeAllow NegativeAutoNoYesWhether the control supports negative numbers. Values: No (0), Yes (1), Auto (99).
SignDisplaySign DisplaySignDisplayHow the negative sign is displayed. Values: None (1), Prefixed (2), Suffixed (3), Parentheses (4), Auto (99).
ShowZeroShow ZeroAutoNoYesWhether a numeric control shows zero or an empty field. Values: No (0), Yes (1), Auto (99).
RotateSignRotate SignAutoNoYesWhether the value is negated for display. Values: No (0), Yes (1), Auto (99).
DisplaceNegativeDisplace NegativeInt32Number of characters a negative number should indent to the right.
FormatMSTFormat MSTAutoNoYesWhether the value is formatted as currency. Values: No (0), Yes (1), Auto (99).
AutoInsSeparatorAuto Ins SeparatorAutoNoYesWhether a decimal separator is inserted automatically. Values: No (0), Yes (1), Auto (99).
Date
DateFormatDate FormatDateFormat_ITxtOrder in which day, month, and year are displayed. Values: Auto (0), YMD (1), YDM (2), MYD (3), DYM (4), MDY (5), DMY (6).
DateDayDate DayDateDayHow the day value is displayed. Values: None (0), Digits1or2 (1), Digits2 (2), Auto (99).
DateMonthDate MonthDateMonthHow the month value is displayed. Values: None (0), Digits1or2 (1), Digits2 (2), Short (3), Long (4), Auto (99).
DateYearDate YearDateYearHow the year value is displayed. Values: None (0), Digits2 (2), Digits4 (4), Auto (99).
DateSeparatorDate SeparatorDateSeparator_ITxtSeparator between year, month, and day values. Values include combinations of Slash, Dash, Dot, Space, None, and ChineseFormal (0–26).
MaxDateLabelMax Date LabelStringText displayed when the value exceeds the maximum date value.
Time
TimeFormatTime FormatTimeFormatDefault time format. Values: Hour24 (1), AMPM (2), Auto (99).
TimeHoursTime HoursAutoNoYesWhether hours are shown. Values: No (0), Yes (1), Auto (99).
TimeMinuteTime MinuteAutoNoYesWhether minutes are shown. Values: No (0), Yes (1), Auto (99).
TimeSecondsTime SecondsAutoNoYesWhether seconds are shown. Values: No (0), Yes (1), Auto (99).
TimeSeparatorTime SeparatorTimeSeparatorSeparator between hours, minutes, and seconds. Values: Colon (1), Dot (2), Space (3), Comma (4), Slash (5), Auto (99).
Enum
EnumTypeEnum TypeStringThe base enumeration whose values are shown in the control.
StyleStyleStyle_ITxtControl display style. Values: Auto (0), Combobox (1), Radiobutton (2).
note

UtcDateTime EDTs inherit both Date and Time properties listed above, plus a TimezonePreference property: User (1), NoConversion (2), Auto (99). Guid and Container EDTs have no type-specific properties beyond the common set.


Child Objects

Every EDT can contain the following child objects:

Relations (AxEdtRelation)

EDT-level relations define a default foreign-key relationship. When a table field uses this EDT, the relation is automatically available unless the field sets IgnoreEDTRelation = Yes.

PropertyDisplay NameTypeDescription
TagsTagsStringTags for this element, separated by semicolons.
TableTableStringThe related table for this relation.
RelatedFieldRelated FieldStringThe field in the related table that this EDT maps to.

AxEdtRelationFixed extends AxEdtRelation with an additional property:

PropertyDisplay NameTypeDescription
ValueValueInt32A fixed value used as a constant constraint in the relation.

Table References (AxEdtTableReference)

Table references provide an alternative way to define relationships, typically used with the ReferenceTable property for surrogate-key (RecId-based) relationships.

PropertyDisplay NameTypeDescription
TagsTagsStringTags for this element, separated by semicolons.
TableTableStringThe reference table for the field.
RelatedFieldRelated FieldStringThe field to relate to in the reference table.

AxEdtTableReferenceFilter extends AxEdtTableReference with an additional property:

PropertyDisplay NameTypeDescription
ValueValueInt32A fixed filter value applied to the table reference.

Array Elements (AxEdtArrayElement)

Array elements allow an EDT to define multiple indexed values stored in separate database columns (a legacy feature from earlier AX versions, rarely used in D365 F&O).

PropertyDisplay NameTypeDescription
NameNameStringThe name of the element.
LabelLabelStringLabel for this array element.
CollectionLabelCollection LabelStringPlural label for this array element.
HelpTextHelp TextStringHelp text for the array element.
IndexIndexInt32The array index.
TagsTagsStringTags for this element, separated by semicolons.

Each array element can also contain its own Relations and TableReferences child objects.