Using Polymorphic Lookups in D365.
Hello Guys,
In our previous blog we have seen how to use two timelines in one form. Today we will understand what is polymorphic lookups and how to use them.
Do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.
In Dynamics CRM 365, while creating lookup field we need to specify one table in the relationship to relate to. Where as for customer field or for regarding field type, you don't have the control to select tables. Consider below example where we are creating a task.
As you can see we have created the task and now we want to specify regarding so that we can identify for which table this task was created. When we choose regarding, we see below options for selecting the lookups.
As you see, we can choose regarding from multiple tables. So here regarding column is known as polymorphic lookup.
When it comes to the option of selecting from multiple tables in one single lookup field, we normally create multiple lookup fields and based on a specific condition, the needed lookup field will be shown on the form.
A Polymorphic Lookup is a lookup that points to multiple tables where the user can switch between these tables in order to select the required record.
We can create Polymorphic Lookup using a plugin named Polymorphic Lookup Manager in XRMToolBox. Let's see how to do it.
We will be creating one polymorphic lookup on People (Person) table named Related Activity which will reference to Task, Phone call, Email and Appointment.
First of all create one solution and add your table into that solution.
As you can see we have already added Person Table. Now open XRM toolbox and connect your organization and start Polymorphic Lookup Manager tool.
Now select your solution and configure as shown below:
You can select as many as tables based on the requirement. Once done click on Create Polymorphic Lookup. This will create one lookup field in Person Table as shown below:
Now you can you this column on your form to capture activity for Person as shown below:
Hope it helps...
Comments
Post a Comment