在查找中禁用查看选择器的Jscript在CRM 2013中不起作用

Mar*_*lic 7 javascript jquery dynamics-crm-2013

我正在使用MS Dynamics CRM 2013,我正面临下一个问题:在CRM 2011中,我通过使用下一个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");
Run Code Online (Sandbox Code Playgroud)

但在迁移到Dynamics Crm 2013后,此脚本不再起作用.

你能帮我解决这个问题吗?谢谢!

Sid*_*sud 3

尝试添加“_i”和 attributeId 例如
contactid 是您的查找属性名称,那么您应该像这样传递

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");
Run Code Online (Sandbox Code Playgroud)

在 crm 2011 中,属性输入 id 与属性名称相同,但在 crm 2013 中,属性输入 id 是属性名称加“_i”(也许“_i”表示输入)。
我在屏蔽和多重选择器列表中尝试了这个“_i”,非常适合 2013 年。希望它对您的情况有所帮助。

/sf/answers/1508665021/