Wednesday, November 20, 2013

Real-time RegEx Tester

Probably the best regex testing tool that I have ever come across:

Use it.

Thursday, March 7, 2013

CRM 2011 - Enable Language error - "A validation error occurred. The value of 'categorycode' on record of type 'reportcategory' is outside the valid range."

I ran into an issue today when trying to enable the Spanish Language pack in a production environment for the client. I received an error and downloaded the log. Here is the log text:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: A validation error occurred. The value of 'categorycode' on record of type 'reportcategory' is outside the valid range.Detail: -2147204326 A validation error occurred. The value of 'categorycode' on record of type 'reportcategory' is outside the valid range. 2013-03-07T16:14:37.6753921Z [Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.TargetAttributeValidationPlugin] [9223a793-ed74-4280-a1fa-2231e0db9424: TargetAttributeValidationPlugin]

Luckily, another blogger had run into the same issue:

Essentially, you need to have all of the out of the box values (1-Sales, 2-Services, 3-Marketing, 4-Administrative) still in place in the categorycode option set field on the Report Related Category entity. I, too, was missing 2 out of the 4 and had to re-add Sales and Marketing. Once you add these values, save, publish and try enabling the language again. It should work this time. Also, fair warning--after you click 'Enable' to enable a language, it warns you that it could take several minutes (8 in my case) to enable the language and CRM may be unreachable to users at this time. Make sure you do this during off hours so that the system has limited down time for users.

Tuesday, March 5, 2013

CRM 2011 - "An error has occurred." when opening a record

Haven't blogged in a while, but thought that since I ran into an issue today that I would share my experience and resolution to the problem. One of our clients said that when they opened a form to validate data, they received this error:

After running a trace on the CRM server, all I could find in the log was an "object reference not set to an instance of an object" error (which doesn't help all that much). So, after doing some more digging, I found this article:

Apparently, the problem has to do with a recently added field which got "stuck" (for lack of a better term) during your last publish of customizations. To resolve the problem, you need to remove the field (in my case, I didn't know which field was causing the issue so I had to remove sections until I found it. A pain, I know, but it's better than having to recreate the entire form.), publish and re-add the field to the form. Once you publish again, try opening the record. The problem should be fixed.

Hope this helps you as much as it helped me!