Hi,
I tried to set the default value in To field of the email entity with the below custom JS code but received the error "isdisabled' filed does not exits for account entity.
function preFilterLookup() {
Xrm.Page.getControl("to").addPreSearch(function () {
addLookupFilter();
});
}
function addLookupFilter() {
fetchXml = "<filter type='and'><condition attribute='isdisabled' operator='eq' uitype='systemuser' value='0' /></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);
}
Please let me know the same for dynamics 365






