Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

Our blog provides a curated collection of tips, tricks, and code snippets that streamline your workflow and enhance your proficiency.
Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

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

0

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.

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

Why Use a Lookup Method?

Normally a look-up is used to list the master data in the system like customer master, vendor master, item master, etc. what will happen if a user is typing these values instead of selecting the values from the lookups.

Consider a supplier order form, there we can select the vendor account using a lookup. Instead of selecting a vendor account using lookup, if the user is trying to type the vendor account details there are many chances to get an error in the input because the user doesn’t know the vendor account which is existing in the database. Also, while selecting a vendor from the lookup, a user can confirm the vendor by checking the other lookup columns which display all the details about the vendor. So, about a user, while editing or creating database records, a lookup makes the data entry easy and errorless.

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.

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

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

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

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.

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

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

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

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

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


How it works...

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

Output

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

Related Tags

How many kinds of lookups can be made and how in d365?
EDT lookup in d365fo
lookup method in d365fo x++ 
systablelookup.add lookup method in d365
addlookupmethod x++
edt lookup in d365fo 
d365fo coc lookup
how to create a lookup field in dynamics 365

Post a Comment

0Comments
Post a Comment (0)