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行内编辑初始方案 ...
随机推荐
- 搭建一个舒适的 .NET Core 开发环境
最近,一直在往.Net Core上迁移,随着工作的深入,发现.Net Core比.Net Framework好玩多了.不过目前还在windows下开发,虽然VisualStudio是宇宙第一神器,但是 ...
- MySQL 千万级 数据库或大表优化
首先考虑如下因素: 1.数据的容量:1-3年内会大概多少条数据,每条数据大概多少字节: 2.数据项:是否有大字段,那些字段的值是否经常被更新: 3.数据查询SQL条件:哪些数据项的列名称经常出现在WH ...
- [Swift]LeetCode14. 最长公共前缀 | Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. If there is n ...
- [Swift]LeetCode60. 第k个排列 | Permutation Sequence
The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the ...
- [Swift]LeetCode91. 解码方法 | Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...
- [Swift]LeetCode340.最多有K个不同字符的最长子串 $ Longest Substring with At Most K Distinct Characters
Given a string, find the length of the longest substring T that contains at most k distinct characte ...
- [Swift]LeetCode764. 最大加号标志 | Largest Plus Sign
In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given lis ...
- IO复用(较详细)
进程与线程的描述 一个进程至少会创建一个线程,多个线程共享一个程序进程的内存.程序的运行最终是靠线程来完成操作的.线程的数量跟CPU核数有关,一个核最多能发出两个线程.线程的操作主要分为:一:给CPU ...
- RSA算法原理——(3)RSA加解密过程及公式论证
上期(RSA简介及基础数论知识)为大家介绍了:互质.欧拉函数.欧拉定理.模反元素 这四个数论的知识点,而这四个知识点是理解RSA加密算法的基石,忘了的同学可以快速的回顾一遍. 一.目前常见加密算法简介 ...
- Agens层次聚类
层次聚类是另一种主要的聚类方法,它具有一些十分必要的特性使得它成为广泛应用的聚类方法.它生成一系列嵌套的聚类树来完成聚类.单点聚类处在树的最底层,在树的顶层有一个根节点聚类.根节点聚类覆盖了全部的所有 ...