How to Create Auto Lookup Using EDT with Table Reference in D365 F&O

 

How to create a lookup in D365FO using X++?

Lookups are the standard way to display a list of possible selection values to the user. For a user, while editing or creating database records, a lookup makes the data entry easy and errorless. In Microsoft dynamics 365 finance and operations, there are many ways of creating lookups.

EDT and Table Relation Type lookups are the simplest forms of lookups in Microsoft dynamics 365 finance and operations.

In this article, I will describe the very simplest type of lookup, which is EDT lookup, for making an EDT type lookup, a developer does not need to worry more about writing x++ coding, 

Normally, standard lookups are created automatically by the system in Dynamics 365 for Finance and Operations and are based on the extended data types and table setup. They are based on table relations and appear automatically. No additional modifications are required.

Setting Up an EDT Lookup

If you are a beginner use Microsoft's free VM, where you can access both the Technical and Functional environments.

In this example, I am considering the standard EDT CustAccount which is already available in the system. 

For this,

Open Application Explorer > Data Types > Extended Data Types



Search the EDT CustAccount, Right click, and select the open designer menu, then the EDT will open in the designer window as shown below.


Expand the Table Relation Node, there you can see one table relation which is,

CustAccount == CustTable.AccountNum

If we are assigning this EDT CustAccount into the newly created field your Table, automatically customer account number is populated in the field. The newly created field is based on EDT CustAccount and therefore, it automatically inherits its relation. So the field will list the Customer Account details which are available in the system for the selected company.

Suppose we are creating a table TbleSalesMen with three columns SalesManId, SalesManName, and CustAccountNum as shown in the figure.



Where you are assigning EDT CustAccount to the Extended Data Type Property of the field CustAccountNum as shown in the figure.


After the successful build of the project, right-click on the table TblSalesMen, select the Open Table Browser menu


How it works...

The newly created CustAccountNum field is based on EDT CustAccount and therefore, it automatically inherits its relation. 

Output
















Comments

Popular posts from this blog

D365FO – AX – Update Data Entity Target Entity fields with X++