EDT'S and Base Enums

Today We are going to explore EDT'S and Base Enums from Basics in Dynamics Ax 2012.

EDT'S:

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.

BENEFITS:

•    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.
Now let's explore how to create an EDT in dynamics AX 2012...
To navigate to Extended Data Types (EDT) node in dynamics Ax 2012 go to Development Work Space (CTRL+SHIFT+D), Expand the Application Object Tree (AOT), navigate to Data Dictionary node and expand it. There you will find the  Extended Data Types (EDT) node.



Steps To create an EDT:

  1.      Right click the Extended Data Types Node
  2.      Select New
  3.      Choose your Desires Primitive Data Type that you want for your EDT




Create an EDT and Set its properties, some Common Properties for All EDTs are as follow:


There are also some other properties which would be covered in further posts, For Learning Purpose You are encouraged to explore more properties by your self :-)

We will discuss EDT's in detail in next posts which will include Array Elements and Table References...

Now Let's move to Enum's And Base Enums...

ENUMS:

•    X++ does not support constants but has an enumerable type (enum), which is a list of literals. You need to create an enum in the Application Object Tree (AOT) before you can use it.
•    Enum values are represented internally as integers. The first literal has number 0, the next has number 1, the next has number 2, and so on. You can use enums as integers in expressions.
•    There are hundreds of enumerable types that are built into the standard application. For example, the enum NoYes has two associated literals, where No has the value 0, and Yes has the value 1.
•    You can create as many enums as you want, and you can declare up to 251 (0 to 250) literals in a single enum type.

CREATING AN ENUM:


  1. Expand the Data Dictionary Node in AOT
  2. Right click the Base Enums Node and select New Base Enum
  3. Rename the Enum
  4. The literals in the enums are called Elements
  5. Right click the Elements and select New Elements
  6. Rename the Element
  7. Add as many elements as you need



Some basic properties of Base Enums Are as follow:


Again you are encouraged to explore more about the enums and Base Enums and let me know in your comments and feed back..
We will be discussing EDT's in detail in next posts which will include Array Elements and Table References...

Hope this Post is informative for you people ...
Thanks...

Comments

Popular posts from this blog

D365: SSRS Report Development/ Customization

D365: X++ code to add custom lookup on worker to show specific workers team workers only

Error message when you log on to a Microsoft Dynamics AX 4.0 client: "You are not a recognized user of Microsoft Dynamics AX"