Hi,
I am trying to add a pre filter to a party list view where 'systemuser' entity's attribute 'ispublic' equals 'yes' for an email activity.
For both 'to' and 'from' views. This is what I've written a function but its working only for 'to' and not working for 'from'.
Obviously I made changes accordingly with the schema names for 'from' but same function. And called them on Form load.
What am I doing wrong?
function preFilterLookup() {
Xrm.Page.getControl("to").addPreSearch(function () {
addLookupFilter();
});
}
function addLookupFilter() {
fetchXml = "<filter type='and'><condition attribute='new_ispublic' operator='eq' uitype='systemuser' value='Yes'/></filter>";
document.getElementById("to_i").setAttribute("defaulttype", "8");
document.getElementById("to_i").setAttribute("lookuptypes", "8");
document.getElementById("to_i").setAttribute("lookuptypeIcons", "/_imgs/ico_16_8.gif");
document.getElementById("to_i").disableViewPicker = 1;
Xrm.Page.getControl("to").addCustomFilter(fetchXml);
}
Thanks