How to implement PreSearch on Lookup field in D365.

Hello Guys,

This blog will explain how you can implement PreSearch on Lookup field based on some conditions.

We all have faced some scenarios where we need to populate lookup field based on some filtration condition so that we can select desire value from those lookup values.

Consider a scenario where we have Contacts which belongs to different region. We want to filter these Contacts based on their region on any other entities like opportunities.

So first will create Region field on contact entity which is type of option set.Also the same field we will created on opportunity entity.




So we have added Region field on both Contact and Opportunity Entity. Now we want when user select region, contacts should be filtered based on selected region. 

To do so we have written Java Script code as below.

 

We will be calling this java script on the change event of Region. So now we have added this script in web resource in CRM. 

Now create a new Opportunity and select Region field and you will see the filtration based on region in contact lookup.



Hope it helps...

Comments

Post a Comment

Popular posts from this blog

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Understanding Sales Process in D365.

Understanding Business Unit in Dynamics 365.