admin管理员组文章数量:1431435
I am working with MS Dynamics CRM 2013 and I am facing with the next issue: in CRM 2011 I disabled view and entity selection on lookup by using next jscript :
document.getElementById("lookup_id").setAttribute("disableViewPicker", "1");
document.getElementById("lookup_id").setAttribute("defaulttype", "1");
document.getElementById("lookup_id").setAttribute("lookuptypenames", "account:1:Account");
document.getElementById("lookup_id").setAttribute("lookuptypes", "1");
But after migration to Dynamics Crm 2013 this script doesn't work any more.
Can you help me with this issue. Thanks!
I am working with MS Dynamics CRM 2013 and I am facing with the next issue: in CRM 2011 I disabled view and entity selection on lookup by using next jscript :
document.getElementById("lookup_id").setAttribute("disableViewPicker", "1");
document.getElementById("lookup_id").setAttribute("defaulttype", "1");
document.getElementById("lookup_id").setAttribute("lookuptypenames", "account:1:Account");
document.getElementById("lookup_id").setAttribute("lookuptypes", "1");
But after migration to Dynamics Crm 2013 this script doesn't work any more.
Can you help me with this issue. Thanks!
Share Improve this question edited Mar 4, 2014 at 17:06 Maria Holic asked Mar 4, 2014 at 15:51 Maria HolicMaria Holic 731 silver badge6 bronze badges 03 Answers
Reset to default 3Try to add "_i" with attributeId e.g
contactid is your lookup attribute name, then you should pass like
document.getElementById("contactid_i").setAttribute("disableViewPicker", "1");
document.getElementById("contactid_i").setAttribute("defaulttype", "1");
document.getElementById("contactid_i").setAttribute("lookuptypenames","account:1:Account");
document.getElementById("contactid_i").setAttribute("lookuptypes", "1");
In crm 2011 attribute input id is same as attribute name, but in crm 2013 attribute input id is attribute name plus "_i"(perhaps "_i" denotes an input).
I try this "_i" in masking and multipicker lists working perfect for 2013. Hope it helps in your case.
https://stackoverflow./a/21552357/1915855
you can also disable it in customization, In the form, when editing the lookup
select in "View selector" -> off
Best practice is to use the Xrm.Page object:
Xrm.Page.ui.controls.get("lookup_id").setDisabled(true);
Gareth Tucker has a great JavaScript reference for Dynamics CRM.
Using the DOM directly is unsupported in Dynamics CRM; the current code you have may break again after an update-rollup is installed. See the JavaScript Programming Best Pratices on this MSDN page.
本文标签: javascriptJscript to disable view picker on lookup doesn39t work in CRM 2013Stack Overflow
版权声明:本文标题:javascript - Jscript to disable view picker on lookup doesn't work in CRM 2013 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745565337a2663726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论