Introduction
In Dynamics 365 Finance and Operations (D365F&O), an auto lookup is a valuable feature that allows users to select a value from a predefined list of options. It's typically used to validate data entries, filter records, or display related information efficiently. For example, an auto lookup might display a list of customers, vendors, or products based on the user's input.
In this blog post, I’ll show you how to create an auto lookup using Extended Data Types (EDT) with table references. This approach ensures that your lookup fields are linked directly to the relevant data tables, making the data entry process more efficient and error-free.
Steps to Create an Auto Lookup Using EDT with Table Reference
Step 1: Create an EDT and Set the Table Reference
-
Create a new EDT (Extended Data Type) in D365F&O to define the data type for your lookup.
-
Open Application Explorer in Visual Studio.
-
Right-click on EDTs under Data Dictionary and select New EDT.
-
-
In the Properties of the EDT, set the Table Reference property to the table containing the values you want to use in the lookup. For instance, if you're creating a lookup for customer groups, set the Table Reference to the CustomerGroup table.
-
Example EDT:
CustGroupRefEDT
for referencing the CustomerGroup table.
Step 2: Create Another EDT (If Needed)
If the field you want to create the lookup for already has a corresponding CustomerGroupId EDT, you can extend that EDT for use in your table. Otherwise, create a new EDT that extends from CustomerGroupId or uses the same EDT as CustomerGroupId.
-
Right-click on the CustomerGroupId EDT (or your desired EDT) and choose Extend.
-
Add this newly extended EDT to the desired table or form as a field where the lookup is needed.
-
Example: Add the
CustGroupRefEDT
to a custom table as a new field.
-
Step 3: Add the EDT to a Table or Form
-
Open your Table Designer in Visual Studio.
-
Add the newly created EDT field to your table.
-
When designing a Form for the table, include this field where you want the auto lookup to appear.
Step 4: Open the Table in the Browser and Verify the Lookup
-
After saving and synchronizing the table, navigate to System Administration > Setup > Data Dictionary > Tables in D365F&O.
-
Find your table and click on Table Browser to open the table data.
-
You will see the lookup functionality in the CustomerGroupId (or equivalent) field, showing the list of values from the referenced table.
Step 5: Synchronize Your Changes
Don’t forget to synchronize the tables after adding the fields to ensure the database schema is updated accordingly.
Conclusion
You’ve now successfully created an auto lookup using an Extended Data Type (EDT) with a table reference in D365F&O. This process allows you to provide users with an efficient and intuitive way of selecting values based on a predefined list from a related table.
By following these steps, you can easily implement lookups for any type of data entity, improving user experience and ensuring data consistency.
I hope you found this blog post helpful! Feel free to share it with your colleagues, and happy coding!
0 Comments