微软CRM记录列表每页显示超过250个记录解决办法
AI摘要
文章介绍了如何通过编写Plugin代码来解决微软CRM记录列表每页显示记录数量限制的问题。通过修改FetchXml中的count属性值,可以将每页显示的记录数量增加到1000个,方便进行批量操作。文章还提供了Plugin的注册方法。
微软CRM记录列表每页显示记录数量只能在25、50、75、100、250中选择一个,有时候经常有需求需要在一页上显示超过250个记录,以便执行某些批量操作功能,比如批量删除、编辑、运行工作流等等;通过Plugin可以实现微软CRM记录列表每页显示超过250个记录,代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
namespace RecordCounterExtender
{
public class RecordCounterExtender:IPlugin
{
public void Execute(IPluginExecutionContext context)
{
if (context.MessageName == "Execute" && context.InputParameters.Contains("FetchXml"))
{
XmlDocument indoc = new XmlDocument();
indoc.LoadXml((string)context.InputParameters["FetchXml"]);
if (indoc.DocumentElement.Attributes["count"] != null)
{
indoc.DocumentElement.Attributes["count"].Value = "1000"; //一页显示1000个记录
context.InputParameters["FetchXml"] = indoc.OuterXml;
}
}
}
}
}
Plugin注册方法:

读者留言 0 条
一纸留言,便是山水间的一次相逢。
还没有留言,欢迎写下第一段交流。