Friday, December 14, 2018

EDT and EDT Relation in AX 2012

Extended data types (EDTs) are user-defined types, based on the primitive data types

  • boolean, 
  • integer, 
  • real, 
  • string, 
  • and date, 
  • and the composite type container.

 You can also base EDTs on other EDTs.

An EDT is a primitive data type or container with a supplementary name and some additional properties.

For example, you could create a new EDT called Name and base it on a string.

Thereafter you can use the new EDT in variable and field declarations in the development environment.


The benefits of EDTs are as follows:


  • Code is easier to read because variables have a meaningful data type. For example, Name instead of string.
  • The properties you set for an EDT are used by all instances of that type, which reduces work and promotes consistency. For example, account numbers (AccountNum data type) have the same properties throughout the system.
  • You can create hierarchies of EDTs, inheriting the properties that are appropriate from the parent and changing the other properties. For example, the ItemCode data type is used as the basis for the MarkupItemCode and PriceDiscItemCode data types.


Define an Extended Data Type as an Array :

You can create an extended data type in the Application Object Tree (AOT) that contains multiple elements. This enables you to store multiple data elements in a single field that is based on this extended data type.

A typical example is an extended data type for handling an address. Instead of defining three fields on your form to enter the address, you can define an extended data type with three elements (the first element exists by default), as shown in the following figure.

Extended Data Types in the AOT


When you create a form based on a table that contains a field of the MyAddress type, MorphX automatically generates a field on your form for each element in the MyAddress definition. The definition of the MyAddress type above causes 3 fields to be generated on a form, called Address, Address1, and Address2.


EDT Relations :


  • We can create the relation in AX with the help of EDT.
  • After creation of EDT in the AX we have to assign the "Reference Table" in the property then we can assign the reference table field in the Table reference node.
  • drag it under fields nodes of your table and it will prompt you for foreign key relationship. if you hit YES, it is going to work and create relationship automatically. 


No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// ...