Showing posts with label MS CRM 2015. Show all posts
Showing posts with label MS CRM 2015. Show all posts

Wednesday, November 22, 2017

Custom Filtering on partylist lookup's MS CRM 2016 & MS CRM 365

Most of us might have come across with business scenario where a system or custom activity  partylist fields like "to","bcc","regardingobjectid"etc need to defaulted to some particular entity. 

In such cases make use of the setLookupTypes method to filter only mentioned entities.

Example 1:
Consider i would like to filter my regardingobjectid field to list only "contact" and "account" entity records.

JavaScript Code:

var regarding = Xrm.Page.getAttribute(“regardingobjectid”); regarding.setLookupTypes(["account","contact"]);

Example 2:
Consider i would like to filter my regardingobjectid field to list only "contact" entity records.

JavaScript Code:

var regarding = Xrm.Page.getAttribute(“regardingobjectid”); regarding.setLookupTypes(["contact"]);

Similarly we can make use of the method to System and custom activity partylist fields.