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.