博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MS CRM 2011 JScript操作lookup control
阅读量:6948 次
发布时间:2019-06-27

本文共 1361 字,大约阅读时间需要 4 分钟。

 

原创地址:

转载请注明出处

 

以contact的parentcustomerid为例,它是一个lookup field。lookup type为account和contact。默认type为account。

 

如果要设置默认type为contact的话,可以

document.getElementById("parentcustomerid").setAttribute("defaulttype", "2"); // 2 是contact object type code

 

如果设置lookup type只为contact,可以

document.getElementById("parentcustomerid").setAttribute("lookuptypes", "2");

 

如果lookup type为account和contact,可以

document.getElementById("parentcustomerid").setAttribute("lookuptypes", "1, 2");

 

设置default view可以

Xrm.Page.getControl("parentcustomerid").setDefaultView("E88CA999-0B16-4AE9-B6A9-9EDC840D42D8");

 

如何获得viewid,如果是personal view, 在Saved View中,复制链接,可以获得viewid

 

如果是System view,在customization中找到EntityName –> Views –> 要选择的view,复制连接,可以获得viewid

 

如果使用的是On-Premise CRM,也可以在CRM数据库中查看。System View可以查看SavedQuery Table, SavedQueryId 是viewid,name field 是 CRM中的view name。如果是personal View,可以看UserQuery Table。UserQueryId 是viewid,name field 是 CRM中的view name

 

最后如果想禁止用户选择其他的view,可以

document.getElementById("parentcustomerid").setAttribute("disableViewPicker", "1");

 

 

总结:

document.getElementById("parentcustomerid").setAttribute("lookuptypes", "2"); document.getElementById("parentcustomerid").setAttribute("defaulttype", "2");        Xrm.Page.getControl("parentcustomerid").setDefaultView("E88CA999-0B16-4AE9-B6A9-9EDC840D42D8"); document.getElementById("parentcustomerid").setAttribute("disableViewPicker", "1");

 

  

你可能感兴趣的文章
6、OC —— 内存管理基本概念
查看>>
在多台linux主机上执行相同的命令
查看>>
1.6的锁优化(适应性自旋/锁粗化/锁削除/轻量级锁/偏向锁)
查看>>
vsm安装(6)
查看>>
webapi使用System.Web.Http.Cors配置跨域访问的几点注意事项
查看>>
使用 JIRA API 更新用户头像
查看>>
IE浏览器“增强保护模式”的笔记
查看>>
SEP防火墙规则处理顺序
查看>>
linux AMP默认安装位置
查看>>
oracle表空间的创建、删除、查看、表空间不存在、及修改默认表空间详解
查看>>
Docker-compose install
查看>>
函数的使用
查看>>
ACL的使用和查看系统上登录的用户的命令使用
查看>>
C/C++源码网站
查看>>
SICP 2.40 2.41 2.42 2.43
查看>>
建立cover组 成员有cover01 cover02 建立team组 成员有team 01 team02 建立user组 成员有user...
查看>>
linux pxe 系统自动化安装
查看>>
iOS游戏开发有奖征文
查看>>
控制台读写
查看>>
LVS+keepalived负载均衡实战
查看>>