Xrm.Utility.openEntityForm的使用
通常需要直接打开某一个form,并且有时需要在打开时直接设置默认值。
SDK中直接给提供了下面这个方法: Xrm.Utility.openEntityForm
结合我个人的实际例子再进行说明:
OpenOrder = function () {var parameters = {};// 为查找类型字段赋值parameters["new_servicerequset"] = Xrm.Page.data.entity.getId();parameters["new_servicerequsetname"] = Xrm.Page.getAttribute("new_requestname").getValue();// 为文本类型字段进行赋值parameters["new_workordername"] = Xrm.Page.getAttribute("new_requestname").getValue();// 为日期类型字段进行赋值 parameters["new_receiving_date"] = "2015-11-15 16:00:00.000";// 或者parameters["new_receiving_date"] = Xrm.Page.getAttribute("new_expected_date").getValue().toDateString();// 为选项集类型字段进行赋值 parameters["new_type"] = Xrm.Page.getAttribute("new_type").getValue();// 打开实体FormXrm.Utility.openEntityForm("new_serviceworkorder", null, parameters);
}
Note:
因为最后会拼接成url字符串,所以赋值时不能直接赋值为object.必须转化为字符串。
例如对日期类型的赋值。
在调用这个方法时通常会出现下面这个错误。
觉得很奇怪,调查之后发现在我们调用 Xrm.Utility.openEntityForm(“new_serviceworkorder”, null, parameters);方法时,最后会把我们传递的参数都拼接成URL字符串,而通常浏览器会对URL的长度有最大限制。
解决方案可以参考下面这个链接:
http://www.cnblogs.com/luchaocai/p/3182510.html
微软官方给出的方案如下:
RESOLUTION
To resolve this problem, follow these steps:
Click Start, type Notepad in the Start Search box, right-click Notepad, and then click Run as administrator.
Note If you are prompted for an administrator password or for a confirmation, type the password, or click Continue.
On the File menu, click Open, type %windir%\System32\inetsrv\config\applicationHost.config in the File name box, and then click Open.
In the ApplicationHost.config file, locate the requestLimits tag.
Remove the maxQueryString property. Or, change the value to a value that matches the length of the query string that you are using. By default, the value of the maxQueryString property is 2048.
For example, modify the following code.
Save the ApplicationHost.config file.
Xrm.Utility.openEntityForm的使用相关推荐
- Dynamics CRM Xrm.Utility.openEntityForm passing lookup parameters
关于 openEntityForm如何传lookup值, 官方的文档里是这么写的 function OpenNewContact() {var parameters = {};//Set the Pa ...
- Xrm.Utility.openEntityForm 时404.15 maxQueryString 错误 和 长度超过maxQueryStringLength值 错误
转载: http://www.cnblogs.com/luchaocai/p/3182510.html
- MS CRM 2011 用Jscript打开新窗口的几种方法
在CRM中,我们经常遇到这样的情况,点击一个按钮,需要弹出一个新的窗口.比如在客户中添加新联系人: 在MS CRM2011中,有以下几种方法可以打开一个新的窗口: (1) Xrm.Utility.op ...
- Microsoft Dynamics CRM 常用JS语法(已转成vs2017语法提示)
背景 最近接触到Microsoft Dynamics CRM的开发.前端js是必不可少的部分,奈何没有一个语法提示,点不出来后续的语句. 在vscode上面搜索插件的时候发现,有一个大神写的插件htt ...
- dynamics crm 常用js
描述 方法 备注 获取当前记录的guid Xrm.Page.data.entity.getId(); 获取当前用户 Xrm.Page.context.getUserId(); 获取当前界面某个字段的 ...
- 在Dynamis CRM中打造一键保存关闭刷新案例的功能
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复172或者20151114可方便获取本文,同时可以在第一时间得到我发布的最新的博文信息,follow me! 我们知道在Dynamics CR ...
- dynamic 365 前端操作
dynamic 365 常用js操作和方法 dynamic 365 常用js dynamic 365 常用js //获取当前用户id Xrm.Page.context.getUserId(): //获 ...
- Dynamics 365 for Phone 使用Xrm.Device.captureImage获取照片
经过了一些研究发现V9版本的model-driven app已经有了很大的提升,可以实现很多可能,比如本篇要分享的在app端调用相机拍照的功能. 我在Ribbon上加了个按钮,按钮上绑定了名叫Capt ...
- 在执行方法和Web资源中获取传递过来参数的值
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复228或者20161026可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
最新文章
- 不懂这几个问题就落后了:Python、Android开发者必读!
- 【转载】jQuery插件开发精品教程,让你的jQuery提升一个台阶
- 私家车合乘系统 matlab,私家车贴上邻里合乘标志 武汉探路拼车合法化
- 信息学奥赛一本通(C++)在线评测系统——基础(一)C++语言——1082:求小数的某一位
- 机器学习分类与性能度量
- 自定义控件(视图)2期笔记03:自定义控件之使用系统控件(优酷案例之广告条Viewpager)...
- java 工作池_Java线程池的工作原理,好处和注意事项
- fastadmin 后台管理 时间戳字段使用
- 定义一个圆形类Circle
- kafka实战教程(python操作kafka),kafka配置文件详解
- 【转】解密微软的架构师之路
- POJ3304 Segments
- FreeRTOS可视化追踪软件 —— 破解Tracealyzer 4.2.12
- 05.odoo12开源框架学习
- app对于接口返回数据的容错测试(健壮性测试)
- 图解HTTP四:返回结果的 HTTP 状态码
- Weakly Supervised Deep Learning for Thoracic DiseaseClassification and Localization on Chest X-rays
- Linux查看端口占用情况的命令
- MessageBox.Show()的使用
- 支付宝直接拉起个人对个人转账 (延伸------网页直接拉起APP操作)