十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
如果要设置默认type为contact的话,可以document.getElementById("parentcustomerid").setAttribute("defaulttype", "2"); // 2 是contact object type code
如果lookup type为account和contact,可以document.getElementById("parentcustomerid").setAttribute("lookuptypes", "1, 2");
设置default view可以Xrm.Page.getControl("parentcustomerid").setDefaultView("E88CA999-0B16-4AE9-B6A9-9EDC840D42D8");
如果想禁止用户选择其他的view,可以document.getElementById("parentcustomerid").setAttribute("disableViewPicker", "1");
为lookup字段添加一个自定义视图 (addCustomView)
var viewId = "{C7034F4F-6F92-4DD7-BD9D-9B9C1E996380}";
var viewDisplayName = "SDK Sample View";
var fetchXml = "
";
Xrm.Page.getControl("parentaccountid").addCustomView(viewId, "account", viewDisplayName, fetchXml, layoutXml, true);