在MSCRM中使用了列表聯動效果後,當客戶端使用IP訪問時,出現“字段windows事件onload錯誤拒絕訪問”的錯誤,而用主機名訪問時則不會出現該錯誤。後上網查諮詢原來是Web資源腳本的問題。
原來的
var serverURL = Xrm.Page.context.getServerUrl();
if (serverURL.match(/\/$/)) {
serverURL = serverURL.substring(0, serverURL.length - 1);
}
var pathToWR = serverURL + "/WebResources/" + webResourceName;
configWR.load(pathToWR);
修改後
var pathToWR = "/" + Xrm.Page.context.getOrgUniqueName() + "/WebResources/" + webResourceName;
configWR.load(pathToWR);
保存發佈後,錯誤清除。