TimeoutException: The request channel timed out while waiting for a reply after 00:00:59.7350618. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.


Hi,

I was getting the above error while working with large number of records using OrganizationServiceProxy in a console application.

Increasing the value for the timeout property resolved the issue.

// set the binding timeout to 20 minute (default is 2 minutes)

organizationProxy.Timeout = new
TimeSpan(0, 20, 0);

Bye.

Advertisements

Fixed – AggregateQueryRecordLimit exceeded. Cannot perform this operation.


Hi,

I was getting the above error in my RetrieveMultiple call in case if the number of records returned were more than 50000.

This limit is governed by ‘AggregrateQueryRecordLimit’ column value of Deployment Properties table in MSCRM_CONFIG database.

Updating it resolved the issue for me. (Remember this is unsupported customization)

 

update DeploymentProperties

set IntColumn = 100000

where ColumnName = ‘AggregateQueryRecordLimit’

 

Hope it helps.

Advertisements

HTTP Error 404.15 – Not FoundThe request filtering module is configured to deny a request where the query string is too long. Exception type: CrmSecurityException Exception message: Could not find GUID for : server$ with SearchFilter: samAccountName


Hi,

Recently got the above error while trying to open the CRM web application. It was because the password for the account which was being used to run CRM services and CRM App Pool was recently changed.

Have a look at this article as well.

http://www.kevinholland.net/professional/crm/crm-4-0-update-rollup-18-gotcha

Bye.

Newly Created Entity not appearing in Stunnware’s Tool (Fetch XML Wizard)


Hi,

I created two new entities in my CRM 2011 development server and thought of writing a fetch xml query using the Fetch XML Wizard tool of Stunnware.

But much to my surprise while trying to add Entities for the query, I was not able to find them in the list. This happens because of the Metadata Cache not getting refreshed. The tool maintains the cache of the metadata. This post helped me in resolving the issue.

http://luckyabhishek.blogspot.in/2011/05/stunnware-fetch-xml-doesnt-show.html

Bye.

Get the total members count of a Dynamic Marketing List in CRM 2011.


Hi,

For a Static Marketing List, we can get the total member count from the attribute “Members Count”.

However this attribute doesn’t’ work for Dynamic Marketing List as this value can only be derived at run time, when the query associated with the list is executed.

One way we can get the total count for the list is by following the below steps.

  • We can get the fetch xml query associated with the Dynamic Marketing List.
  • Remove the attribute and order tag from it.
  • Modify it  to include aggregate function.

Sample Code in C#

 private void btnGetMembersDynamicML_Click(object sender, EventArgs e)
 {
 IOrganizationService orgService = GetOrganizationService();

ColumnSet cols= new ColumnSet(new string[] { "query" });

// GUID of the Dynamic Marketing List
 var entity = orgService.Retrieve("list", new Guid("03C4E473-F7DA-E111-B988-00155D886334"), cols);
 var dynamicQuery = entity.Attributes["query"].ToString();

var countQuery = ModifyFetchXML(dynamicQuery);

var memberCountResult = orgService.RetrieveMultiple(new FetchExpression(countQuery));

DataCollection<Entity> dataCollection = memberCountResult.Entities;

int totalMembers = default(int);
 if(dataCollection != null && dataCollection.Count > 0)
 {
 foreach(Entity entityVal in dataCollection)
 {
 AliasedValue value = (entityVal.Attributes["member_count"] as AliasedValue);
 totalMembers = (int)value.Value;
 }
 }

MessageBox.Show("Total Members : " + totalMembers.ToString());

}

private static string ModifyFetchXML(string dynamicQuery)
 {
 var doc = new XmlDocument();
 doc.LoadXml(dynamicQuery);

var entitynode = doc.GetElementsByTagName("entity")[0];

int childCount = entitynode.ChildNodes.Count;

// Remove all the attribute and order tag
 for (int i = 0; i <= childCount; i++)
 {
 var attributenode = entitynode.SelectSingleNode("//attribute");
 if (attributenode != null) entitynode.RemoveChild(attributenode);
 else
 {
 var ordernode = entitynode.SelectSingleNode("//order");
 if (ordernode != null) entitynode.RemoveChild(ordernode);
 }
 }

// add a new attribute tag
 // <attribute name="fullname" alias="member_count" aggregate="count" />
 XmlElement xmlNodeCustomSettings = doc.CreateElement("attribute");

xmlNodeCustomSettings.SetAttribute("name", "contactid");
 xmlNodeCustomSettings.SetAttribute("alias", "member_count");
 xmlNodeCustomSettings.SetAttribute("aggregate", "count");

entitynode.AppendChild(xmlNodeCustomSettings);

// Add aggregate= true attribute
 // <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" aggregate="true">
 var root = doc.DocumentElement;
 if (root != null) root.SetAttribute("aggregate", "true");

return doc.InnerXml;
 }

public IOrganizationService GetOrganizationService()
 {
 Uri organizationUri = new Uri("http://servername/orgname/XRMServices/2011/Organization.svc");
 Uri homeRealmUri = null;
 ClientCredentials credentials = new ClientCredentials();
 credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
 OrganizationServiceProxy orgProxy = new OrganizationServiceProxy(organizationUri, homeRealmUri, credentials, null);
 IOrganizationService _service = (IOrganizationService)orgProxy;
 return _service;
 }

Hope it helps.

“System.ArgumentException: The specified string is not in the form required for a subject” error while sending mail through plugin in CRM 2011.


Hi,

We were getting the above error in one of our plugin which was using SendEmailRequest to send mail.

As it turned out it was because of the subject not being in proper format in the template

 

 

Hope it helps.