Idea of plugin - is to catch Execute message and change quantity of records per page.
Here the code of plugin:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
using Microsoft.Win32;
using System.Xml;
using Microsoft.Crm.SdkTypeProxy.Metadata;
using Microsoft.Crm.Sdk.Metadata;
namespace TestPlugin
{
public class RecordCounterExtender : IPlugin
{
public RecordCounterExtender(string config, string secureConfig)
{
}
#region IPlugin Members
public void Execute(IPluginExecutionContext context)
{
if (context.MessageName == "Execute" && context.InputParameters.Contains("FetchXml"))
{
XmlDocument indoc = new XmlDocument();
indoc.LoadXml((string)context.InputParameters["FetchXml"]);
indoc.DocumentElement.Attributes["count"].Value = "1000";
context.InputParameters["FetchXml"] = indoc.OuterXml;
}
}
#endregion
}
}
Here the result:
Step of plugin must be registered as a Pre Execute.
Can you put up a screen shot of the Register New Step, or list the details. I'm not sure what to put for message
ReplyDeleteIf you could also mention the registration process along. I'm not sure where exactly to register the plugin.
ReplyDeleteThanks.
Hi. You can download pluginregistrator here - http://www.axforum.info/forums/attachment.php?attachmentid=4623&d=1241709390.
ReplyDeleteYou have to make plugin's assembly strongnamed, buid and register it on CRM Server using pluginregistrator. Then you have to register a step - Message is Execute, Pre Event Stage, Synchronous, primary entity and child entity is none.
Hello Adrij,
ReplyDeleteThank you for code. When I try to use Advanced find with this plugin, I recieve the following error message:
NullReferenceException: Object reference not set to an instance of an object.]
at Page1kRecordsPlugin.RecordCounterExtender.Execute(IPluginExecutionContext context)
at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context)
How I can handle this situation? How I can analyze the Advanced Find on the input? Thank you.
Hi, Roman.
ReplyDeleteCheck my new post http://a33ik.blogspot.com/2009/09/overriding-records-per-page-count-for.html issue you've found was fixed there.
Thank you!
ReplyDeleteHi, Roman. I am very appreciated for testing my solutions.
ReplyDeleteHi Andriy,
ReplyDeleteHappy New Year 2011.
Please provide some input with "how to set CRM IFD for CRM 2011 via ADFS?"
Thanks,
Jags
Hi Jags.
ReplyDeleteThank you for the greetings. To get some "inputs" you should visit following forum - http://social.microsoft.com/Forums/en-US/crm2011beta/threads
Do you have record counter for ms crm 2011
ReplyDeleteHello Mohita,
ReplyDeleteWhy do you need it for CRM 2011?