Preventing Timeouts with Dynamics CRM 3.0

On March 22, 2006, in Dynamics CRM, by Mitch Milam

The main SQL Server ( 2000 ) at my current customer becomes overloaded at times due to month-end processing requirements, etc.

This can be really irritating when you're trying to create new CRM Entities, which is one of the most intensive database tasks you can do to CRM.

The errors you will see when the operation times out will vary, but usually result in a Timeout message, or one of the famous, "An error has occurred. Contact your system administrator."

Enabling CRM Tracing has shown that we're getting timeouts to the database or by the .NET process aborting its thread.  Either way, an error will be produced.

I researched the situation about two weeks ago and came across a really fine article from Simon Hutson on what, at first glance, seems to be a totally unrelated topic. However, it is very much related and after running the changes on my test box for a while, I detemined it was safe to install them in production.

The changes did indeed prevent errors from occurring, but if there was a delay, you will be setting at the little yellow "saving" status box for quite a while. Maybe several minutes. But, I think a delay is better than seeing an error message.

Note: I'm going to make a very broad assumption that I don't need to tell you to use caution when making registry changes, make backups, etc.

  

Step1:

There are three changes that need to be made to the registry. I've attached a ZIP file to this article that has the .REG files ready to use.

Step 2:

Open the web.config file for your CRM web site and increase the executionTimeout to a larger amount. I chose 900 seconds:

httpRuntime executionTimeout="900" 

Step 3:

Reboot the CRM server.

  

References:

Microsoft CRM 3.0 setup error and TCP/IP ephemeral ports

Download: Reg Files

 

 

My current project developed a requirement to display the Contact information on a tab on the Opportunity Entity.  Pretty simple, I thought, just create a new tab, throw on an iFrame and put a reference to one of the CRM pages that will display the contact for me.

Pretty simple, on paper.  Execution turned it into something quite different that took me much longer that I would have hoped.  Anyway, here is the solution:

1. Create a new tab and insert an iFrame.

2. Set the URL field to: 

http://server/_forms/readonly/readonly.aspx?obTypeCode=1&id=

Which will make the form look like this: 

 

3. In the Form's OnLoad Event, place the following code:

if (crmForm.all.customerid.DataValue[0].id != null)
{
var ContactURL = "http://crm/_forms/readonly/readonly.aspx?objTypeCode=2&id="
crmForm.all.IFRAME_ContactInfo.src = ContactURL + crmForm.all.customerid.DataValue[0].id;
}

This code will add the GUID or Unique ID to the URL for your iFrame so that when you click on the Contact Info tab, you see the contact information for the Contact associated with the Opportunity.

It took me longer than usual because the information in the SDK was incorrect.  Thanks to Matt Whittemann for instructions to get around that issue and to Ronald Lemmen for information on how to display the read-only form.

Revision: 3/31/2007:

When you define the iFrame properties, you need to uncheck the Restrict cross-frame scripting in order for this to work properly.

 

References: 

Dynamics CRM 3.0 SDK: Client Programming, iFrame Support

Dynamics CRM 3.0 SDK: Client Programming, URL Addressable Forms

Dynamics CRM 3.0 SDK: Client Programming, Lookup Field Types

CRM newsgroup post

New Example of Javascript OnChange Code For CRM 3.0

 

 

 

Only in America

On March 22, 2006, in Meanderings, by Mitch Milam

I was on the road last week and when I returned, I realized that my MasterCard payment was due on Monday.  I had recently added a new back to the automatic transfer system and for some reason, it take 5-7 business days to get that link working.

So, I decided to just call them and may a payment by check over the phone, from my new bank account.

"No problem," they said.  "There will be a transaction fee of $14.95."

I laughed, thought a few evil thoughts about CitiGroup and went ahead with it.

So let me repeat back to you what I heard from the customer service rep:

"We are going to charge you $15 to take your money, because either A) you're costing us money by calling our 800 number; or B) we don't actually like you."

Did I mentioned that it cost me $15 extra to pay them money that I owed them?

 

 

As the saying goes…

On March 9, 2006, in Meanderings, by Mitch Milam

from my part of the world:

"I may not be right, but I'm sure."

[if you don't get it, leave me a comment and I'll explain it.]

 

RSS Feed for this blog

On March 9, 2006, in Misc, by Mitch Milam

I am going to switch over my main RSS feed for this blog over to Feedburner later today so I can get a better handle on usage, etc.

So, for those of you using RSS, you'll need to resync your aggregator tonight or tomorrow.

Thanks, Mitch

 

I encountered an interesting issue this morning that required interesting solution.

I had to change an attribute type from NVARCHAR to NTEXT due to some data import issues ( I'm assuming ).  When I added the Field back to the Form, it automatically occupied two cells in the Form ( the section was two-column ).

Now personally, I was a bit irritated with CRM taking license with my Form design. Especially when I could only control the number of lines high the Field would be.

So instead of getting mad, I got even, and corrected the issue by doing the following:

  1. Export the Entity.
  2. Open in WordPad.
  3. Find the FormXML section and locate the field in question.
  4. Change colspan="2" to colspan="1"
    ( colspan is HTML-speak for: how many table columns does
      this cell occupy )
  5. Save the file
  6. Import the Entity
  7. Publish the Entity

And there you have it. 

Since the sky didn't open up and start bleeding or anything, I'm assuming this is a supported action.  Your mileage my vary.

 

 

Lesson Learned: Hot Buttered Rum Mix Storage

On March 8, 2006, in Meanderings, by Mitch Milam

A plastic bag is NOT suitable storage for extra Hot Buttered Rum mix prior to freezing.

While it looks good on paper, you need at least three hands to make it work:

  1. One to hold the bag open
  2. One to hold the mixing jar
  3. One to scrape the mixture out of said jar into said bag

Otherwise, you end up with the crap everywhere.

Use one of those little plastic containers next time.

OR, better yet.

Buy more Rum so you don't have to store anything. :)

 

 

Is it me?

On March 8, 2006, in Meanderings, by Mitch Milam

Or is that chick on http://www.godaddy.com hot?

I make it a point to go buy one domain a day just so I can see that twinkle in her eye.

You don't think that's airbrushed in, do you?

 

thought of the day

On March 5, 2006, in Meanderings, by Mitch Milam

So I'm on the phone last night and I say, "Why don't you come over and clean my house tomorrow."

And she says, "I don't think I know you well enough."

And I say, "That's not funny Mom."

:)

[PS. that didn't really happen]

 

A note for new home owners

On March 4, 2006, in Meanderings, by Mitch Milam

If you never listen to another piece of advice from me again, please listen to this one:

Never, ever. Ever. Buy a cheap water hose.

Ever.

Buying a cheap water hose is like renting a $35 hooker. It may look good all packaged up, but once you start using it, you'll find a lifetime of grief and irritation.

 

And no Mom, I've never rented a hooker for any amount.  Love you Mom.