function preFilterLookup() { Xrm.Page.getControl("parentaccountid").addPreSearch(function () {
addLookupFilter(); addLookupFilter(); });}function addLookupFilter() {
var email = Xrm.Page.getAttribute("emailaddress1").getValue(); if (email != null) {
fetchXml = fetchXml = "<filter type='and'><condition attribute='emailaddress1' operator='eq' value='" + email + "' /></filter>"; Xrm.Page.getControl("parentaccountid").addCustomFilter(fetchXml);
}
} }}
THe preFilterLookup() function needs to be called from the onload
No comments:
Post a Comment