CRM JS 设置lookup字段 setSimpleLookupValue
function setSimpleLookupValue(LookupId, Type, Id, Name) {
/// <summary>
/// Sets the value for lookup attributes that accept only a single entity reference.
/// Use of this function to set lookups that allow for multiple references,
/// a.k.a 'partylist' lookups, will remove any other existing references and
/// replace it with just the single reference specified.
/// </summary>
/// <param name="LookupId" type="String" mayBeNull="false" optional="false" >
/// The lookup attribute logical name
/// </param>
/// <param name="Type" type="String" mayBeNull="false" optional="false" >
/// The logical name of the entity being set.
/// </param>
/// <param name="Id" type="String" mayBeNull="false" optional="false" >
/// A string representation of the GUID value for the record being set.
/// The expected format is "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}".
/// </param>
/// <param name="Name" type="String" mayBeNull="false" optional="false" >
/// The text to be displayed in the lookup.
/// </param>
///setSimpleLookupValue("primarycontactid", "contact", "{6D9D4FCF-F4D3-E011-9D26-00155DBA3819}", "Brian Lamee");
var lookupReference = [];
lookupReference[0] = {};
lookupReference[0].id = Id;
lookupReference[0].entityType = Type;
lookupReference[0].name = Name;
Xrm.Page.getAttribute(LookupId).setValue(lookupReference);
Xrm.Page.getAttribute(LookupId).setSubmitMode("always");
}
CRM JS 设置lookup字段 setSimpleLookupValue的更多相关文章
- SharePoint 设置Lookup 字段的值
如何设置Lookup字段的值, 首先我们同样需要了解SPFieldLookupValueCollection和SPFieldLookupValue, 这2个类的原理和之前所讲解到SPFieldUser ...
- Dynamic CRM 2013学习笔记(二十三)CRM JS智能提示(CRM 相关的方法、属性以及页面字段),及发布前调试
我们知道在CRM的js文件里引用XrmPageTemplate.js后,就可以实现智能提示,但每个js文件都引用太麻烦了,其实可以利用vs的功能让每个js文件自动实现智能提示CRM的js: 另外,我们 ...
- CRM 2016 设置字体颜色
作者:卞功鑫 ,转载请保留http://www.cnblogs.com/BinBinGo/p/7402809.html setTimeout("window.parent.document. ...
- 在标准实体特殊消息上注册插件及Dynamics CRM 2015中计算字段的使用
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复157或者20151005可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 前面的 插件系列博客教程 讲述了 ...
- 纯 JS 设置文本框的默认提示
HTML5 中有个新特性叫 placeholder,一般用它来描述输入字段的预期值,适用于 text.search.password 等类型的 input 以及 textarea.示例如下: < ...
- js设置css样式.
在js设置css样式做法 var obj = document.getElementById('div'); obj.style.width = '100px'; obj.style.height = ...
- js设置、获取单值cookie和多值cookie
js设置.获取单值cookie和多值cookie,代码如下: var CookieUtil = (function () { var Cookie = function () { // 获取单值coo ...
- 使用js 设置组合快捷键
使用js 设置组合快捷键 使用js设置快捷键的本质就是获得你要设置的这个键的keyCode 的值,如果要加ctrl,alt,shift,那么就添加一个ctrlkey,altKey,shiftKey来判 ...
- 运用JS设置cookie、读取cookie、删除cookie
JavaScript是运行在客户端的脚本,因此一般是不能够设置Session的,因为Session是运行在服务器端的.而cookie是运行在客户端的,所以可以用JS来设置cookie. 假设有这样一种 ...
随机推荐
- iOS开发UI篇—UITableview控件简单介绍
iOS开发UI篇—UITableview控件简单介绍 一.基本介绍 在众多移动应⽤用中,能看到各式各样的表格数据 . 在iOS中,要实现表格数据展示,最常用的做法就是使用UITableView,UIT ...
- AFN实现多图片上传的方法
[[AFAppDotNetAPIClient sharedClient] POST:path parameters:dic constructingBodyWithBlock:^(id<AFMu ...
- Python collections 模块用法举例
Python作为一个“内置电池”的编程语言,标准库里面拥有非常多好用的模块.比如今天想给大家 介绍的 collections 就是一个非常好的例子. 1.collections模块基本介绍 我们都知道 ...
- 通过cpu SN码注册软件类
using System; using System.Management; namespace SoftReg { internal class SoftReg { #region 变量 ]; // ...
- Ubuntu操作系统安装使用教程 (转)
随着微软的步步紧逼,包括早先的Windows黑屏计划.实施,逮捕番茄花园作者并判刑,种种迹象表明,中国用户免费使用盗版Windows的日子将不会太长久了,那么这个世界上有没有即免费又易用的操作系统呢? ...
- ASP.NET Cookie存值问题
想必 用Cookie存值已经是很普遍的了,我也是刚学习了一点皮毛,现在就记下一点知识,便于日后翻阅. 1.C#代码存取Cookie值 //用Request获取到客户端Cookie 判断是否为空 if ...
- php 无法连接mysql
sql_connect,sqli_connect, 或new sqli() 无法建立mysql连接 1. php.ini 中 ; extension=php_mysql.dll 和 ; extensi ...
- RFID Hacking④:使用ProxMark3 破解门禁
文中提及的部分技术可能带有一定攻击性,仅供安全学习和教学用途,禁止非法使用! 0×00 前言 国际黑客大会Defcon传统之一:开锁!因为黑客认为锁也是一种安全挑战.我们在黑客题材电影.电视剧中也常常 ...
- Turing Tree_线段树&树状数组
Problem Description After inventing Turing Tree, 3xian always felt boring when solving problems abou ...
- sublime text3 快捷键设置
//插入到key binding user 里面,浏览器安装路径修改成自己的路径 1[ //firefox测试快捷键 { "keys":["f3"], &quo ...