Dynamics 365新功能:可编辑的网格(行内编辑)
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复238或者20161127可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong.me 。
static void Main(string[] args)
{
try
{
var crmSvc = new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM365"].ConnectionString);
if (crmSvc.IsReady)
{ //<snippetDumpEditableGridEntityInfo1>
RetrieveAllEntitiesRequest request = new RetrieveAllEntitiesRequest()
{
EntityFilters = EntityFilters.Entity,
RetrieveAsIfPublished = true
}; // Retrieve the MetaData.
RetrieveAllEntitiesResponse response = (RetrieveAllEntitiesResponse)crmSvc.Execute(request); // Create an instance of StreamWriter to write text to a file.
// The using statement also closes the StreamWriter.
// To view this file, right click the file and choose open with Excel.
// Excel will figure out the schema and display the information in columns. String filename = String.Concat("EditableGridEntityInfo.xml");
using (StreamWriter sw = new StreamWriter(filename))
{
// Create Xml Writer.
XmlTextWriter metadataWriter = new XmlTextWriter(sw); // Start Xml File.
metadataWriter.WriteStartDocument(); // Metadata Xml Node.
metadataWriter.WriteStartElement("Metadata"); foreach (EntityMetadata currentEntity in response.EntityMetadata)
{
// Start Entity Node
metadataWriter.WriteStartElement("Entity"); bool canBeDisplayedInSitemap = currentEntity.IsCustomizable.Value; if (canBeDisplayedInSitemap)
{
metadataWriter.WriteElementString("LogicalName", currentEntity.LogicalName);
metadataWriter.WriteElementString("DisplayName", currentEntity.DisplayName.UserLocalizedLabel?.Label);
metadataWriter.WriteElementString("CanEnableEditableGridWeb", (!(bool)currentEntity.IsChildEntity && ((bool)currentEntity.IsAIRUpdated || (bool)currentEntity.IsCustomEntity)).ToString());
metadataWriter.WriteElementString("CanEnableEditableGridMobile", (currentEntity.IsVisibleInMobileClient.Value || currentEntity.IsVisibleInMobileClient.CanBeChanged).ToString());
} // Write the Entity's Information. //End Entity Node
metadataWriter.WriteEndElement();
} // End Metadata Xml Node
metadataWriter.WriteEndElement();
metadataWriter.WriteEndDocument(); // Close xml writer.
Console.WriteLine("Dumped information in the EditableGridEntityInfo.xml file");
}
}
else
{
Console.WriteLine("连接CRM出错:" + crmSvc.LastCrmError);
}
Console.WriteLine("程序运行完成!");
Console.ReadKey();
}
catch (FaultException ex)
{
Console.WriteLine("程序出现异常:ex.Message=" + ex.Message);
Console.ReadKey();
}
}











点击客户名称旁边的图标,就会将我在业务规则中设置的消息显示出来:

function accountNameOnchangeHandler(execObject) {
var entityObject = execObject.getFormContext().data.entity;
var nameAttr = entityObject.attributes.getByName('name');
var isNameContainstest = nameAttr.getValue().indexOf('测试') === -1;
// nameField will be an Xrm.Page control if invoked from a form OnChange event;
// nameField will be a editable grid GridCell object if invoked from editable grid OnChange event.
var nameField = nameAttr.controls.getByIndex(0);
if (!isNameContainstest) {
nameField.setNotification('客户名称不能包括测试二字!', 'nameNotification');
}
else {
nameField.clearNotification('nameNotification');
}
}

需要注意的是设定客户名称OnChange的时间执行程序的时候需要 将执行上下文作为第一个参数传递 这个选中。


Dynamics 365新功能:可编辑的网格(行内编辑)的更多相关文章
- jQuery EasyUI 数据网格 - 启用行内编辑(转自http://www.runoob.com/jeasyui/jeasyui-datagrid-datagrid12.html)
可编辑的功能是最近添加到数据网格(datagrid)的.它可以使用户添加一个新行到数据网格(datagrid).用户也可以更新一个或多个行.本教程向您展示如何创建一个数据网格(datagrid)和内联 ...
- 雷林鹏分享:jQuery EasyUI 数据网格 - 启用行内编辑
jQuery EasyUI 数据网格 - 启用行内编辑 可编辑的功能是最近添加到数据网格(datagrid)的.它可以使用户添加一个新行到数据网格(datagrid).用户也可以更新一个或多个行. 本 ...
- EasyUI 启用行内编辑
创建数据网格(DataGrid) $(function(){ $('#tt').datagrid({ title:'Editable DataGrid', iconCls:'icon-edit', w ...
- Django项目:CRM(客户关系管理系统)--69--59PerfectCRM实现king_admin行内编辑
#base_admin.py # ————————24PerfectCRM实现King_admin自定义操作数据———————— from django.shortcuts import render ...
- ASP.NET Aries 入门开发教程6:列表数据表格的格式化处理及行内编辑
前言: 为了赶进度,周末也写文了! 前几篇讲完查询框和工具栏,这节讲表格数据相关的操作. 先看一下列表: 接下来我们有很多事情可以做. 1:格式化 - 键值的翻译 对于“启用”列,已经配置了格式化 # ...
- JS组件系列——BootstrapTable 行内编辑解决方案:x-editable
前言:之前介绍bootstrapTable组件的时候有提到它的行内编辑功能,只不过为了展示功能,将此一笔带过了,罪过罪过!最近项目里面还是打算将行内编辑用起来,于是再次研究了下x-editable组件 ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(83)-Easyui Datagrid 行内编辑扩展
这次我们要从复杂的交互入手来说明一些用法,这才能让系统做出更加复杂的业务,上一节讲述了Datagird的批量编辑和提交本节主要演示扩展Datagrid行内编辑的属性,下面来看一个例子,我开启编辑行的时 ...
- datatables表格行内编辑的实现
Datatables是一款jquery表格插件,它是一个高度灵活的工具,灵活就意味着很多功能需要自己去实现,比如说行内编辑功能. Datatables自己是没有行内编辑功能的,最简单的是通过modal ...
- [转]JS组件系列——BootstrapTable 行内编辑解决方案:x-editable
本文转自:http://www.cnblogs.com/landeanfen/p/5821192.html 阅读目录 一.x-editable组件介绍 二.bootstrapTable行内编辑初始方案 ...
随机推荐
- 【原创开源应用第5期】基于RL-USB+RL-FlashFS的外挂U盘解决方案
说明:1.RL-USB外挂U盘的例子,最近太多网友咨询,再不做一个例子就说不过去了.此例子为此而生.2.RTX及其所有中间件基本都做例子了,就差这个USB Host功能了,这次算是补上,所有功能基本已 ...
- [Swift]LeetCode69. x 的平方根 | Sqrt(x)
Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a no ...
- [Swift]LeetCode150. 逆波兰表达式求值 | Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, ...
- [Swift]LeetCode268. 缺失数字 | Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...
- [Swift]LeetCode907. 子数组的最小值之和 | Sum of Subarray Minimums
Given an array of integers A, find the sum of min(B), where B ranges over every (contiguous) subarra ...
- python 抓取糗事百科糗图
1 首先看下要抓取的页面 这是糗事百科里面的糗图页面,每一页里面有很多的图片,我们要做的就是把这些图片抓取下来. 2 分析网页源代码 发现源代码里面的每张图是这样储存的,所以决定使用正则匹配出图片的u ...
- spring boot - 整合jpa
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring- ...
- 【Spark篇】---Spark资源调度和任务调度
一.前述 Spark的资源调度是个很重要的模块,只要搞懂原理,才能具体明白Spark是怎么执行的,所以尤其重要. 自愿申请的话,本文分粗粒度和细粒度模式分别介绍. 二.具体 Spark资源调度流程图: ...
- Python内置函数(57)——setattr
英文文档: setattr(object, name, value) This is the counterpart of getattr(). The arguments are an object ...
- BBS论坛(二十一)
21.1.编辑轮播图功能完成 (1)cms_banners.html 把属性绑定到<tr>上面,方便找到各属性的值 <tbody> {% for banner in banne ...