Symptom

Your Windows Live ID becomes locked or disabled by the system because the account has 100,000+ failed login attempts.

 

Cause

You have the email router configured to access CRM Online using your Windows Live ID account.

You then change your password, forgetting that the email router also used this account.

The email router attempts a connection to CRM Online on an alarmingly frequent basis and since the stored credentials no longer match, the login fails.

Soon thereafter, the Windows Live ID system will assume someone is mounting a hacking-attack and will disable the account for you.

 

Resolution

The first thing to do is properly document your system configuration so that you, and hopefully other people, know what credentials are being used to access what services.

Next, you'll have to stop the email router service.

Then open a case with Windows Live ID support and have them enable your account.

At this point you can either change the password on the stored credentials the email router is using to access the system.  Even better, if it is possible, is create a new Windows Live ID account that can be used specifically for this purpose.  Add that user to your CRM Online instance and configure the router to use those credentials.

Restart the email router service and make sure mail is flowing.

The go back and document what you just did so you and anyone else in your organization know what the cause and solution were.

We are restarting the D/FW chapter of the CRM User Group. If you are interested in attending, then please let me know.

Just drop me an email: mitch at crmaccelerators dot net

,

Marc Schweigert of Microsoft has released more goodness for Dynamics CRM Developers.

His latest is this:

Unit testing CRM 2011 JavaScript web resources

This is in addition to this technique for plug-in developers:

How I develop and unit test CRM 2011 plugins

 

Also of interest is today's presentation of Team Development with Shan McArthur for the XrmVirtual User's Group:

http://www.xrmvirtual.com/events/team_dev_ShanMc_CRM2011

 

It's always great to see people putting the time and interest into topics that help us all do our jobs.

Thanks Gentlemen.

Each CRM organization has two names associated with it:

The Friendly Name

This is the name that is displayed in the user interface:

image

The Unique Name

This is the name of the database and can be found on the Developer Resources page, under Settings, Customization:

image

 

The CRM Discover Service contains a message called: RetrieveOrganizationsRequest which allows you to retrieve all of the CRM organizations to which you have access.

Many developers, myself included, use this feature to allow a user to select and connect to a specific CRM organization.

The Problem

This week I noticed that the information found on the Developer Resources page did not match up to the information returned in the RetrieveOrganizationResponse object.

So, if you provide instructions to your end-users on how to retrieve their Organization Unique Name, there is a possibility that the information they provide and the information your application has access to will not be the same.

In my case, I use the unique name for licensing purposes and such a mismatch would cause a licensing failure which would limit or disable product functionality.

The Solution

It is my guess that a change was made recently to CRM Online so that the unique name actually matches the URL name, as you can see below:

image

As of today, that is the unique name being returned when I query my organization.

An article for CRM Online 4.0 talks about a similar circumstance back in 2009:

http://blogs.msdn.com/b/crm/archive/2009/10/23/changes-a-foot-provisioning-unique-names-changes-in-microsoft-dynamics-crm.aspx

I am not sure if a similar scenario with CRM 2011 applies, but it sure looks like it to me.

Over the past couple of years, we've seen the following possible values returned:

  • The unique name as shown in the user interface
  • The URL name
  • The Friendly Name ( rare but occasional cases )

 

Note: this does not seem to be an issue with CRM On-premise.

 

So, if you are a developer and you are retrieving organizational information, keep in mind that the information you receive may or may not be what you expect.

The ultimate documentation tool for Dynamics CRM 2011 extracts and consolidates the following components:

  • System Settings
  • Entities
  • Fields
  • Relationships
  • Views
  • Forms
  • Option Sets
  • Security Roles
  • Field Security
  • Solutions
  • Web Resources
  • Plugins
  • Processes
  • Templates
  • Business units
  • Users
  • Teams
  • Queues

 

Pricing

SnapShot! will be priced at $49 per CRM organization.

 

For More Information

Visit the product page for more information.

The ultimate documentation tool for Dynamics CRM 2011 extracts and consolidates the following components:

  • System Settings
  • Entities
  • Fields
  • Relationships
  • Views
  • Forms
  • Option Sets
  • Field Security
  • Solutions
  • Web Resources
  • Plugins
  • Processes
  • Templates
  • Business units
  • Users
  • Teams
  • Queues

 

Pricing

SnapShot! will be priced at $49 per CRM organization.

 

For More Information

Visit the product page for more information.

Hi Everyone,

Sometime this week I'll be releasing SnapShot! for Dynamics CRM 2011.

Overview

I work with organizations all of the world and find it necessary to to collect as much information about the CRM installation as possible, in order to educate myself as to what has been done to the system so that we can accomplish whatever goal was established when I was first brought in.

This is the tool that I created to solve that problem.

SnapShot! documents the following Dynamics CRM 2011 components:

  • System Settings
  • Entities
  • Fields
  • Relationships
  • Views
  • Forms
  • Option Sets
  • Field Security
  • Solutions
  • Web Resources
  • Plugins
  • Processes
  • Templates
  • Business units
  • Users
  • Teams
  • Queues

The output consists of an Excel worksheet containing most of the data and a Word document that lists the security role privileges.

 

Pricing

SnapShot! will be priced at $49 per CRM organization.

 

Sample Report

You may download a sample report from one of my developer organizations here.

The report was generated from the Contoso demo organization but has had additional commercial and custom solutions added to it, as many typical CRM organizations have. This should give you a good feel for the data being extracted.

 

Feedback

If you have any suggestions or comments, please drop me an email:

mitch at crmaccelerators dot net

 

Otherwise, stay tuned!

There may be times when developing custom Dynamics CRM components that errors occur which may or may not involve your code.

This, of course, has never happened to me because I write bug-free code all of the time-but I have seen it happen to other developers. Smile

Any, you may find yourself staring at an error message that looks something like this:

Unhandled Exception: System.ServiceModel.FaultException`1
[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, 
Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: 
An unexpected error occurred.Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147220891</ErrorCode>
  <ErrorDetails 
    xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <d2p1:key>OperationStatus</d2p1:key>
      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" 
                  i:type="d4p1:int">0</d2p1:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <Message>An unexpected error occurred.</Message>
  <Timestamp>2012-11-19T15:55:39.8208026Z</Timestamp>
  <InnerFault>
    <ErrorCode>-2147220891</ErrorCode>
    <ErrorDetails 
       xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
      <KeyValuePairOfstringanyType>
        <d3p1:key>OperationStatus</d3p1:key>
        <d3p1:value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" 
                    i:type="d5p1:int">0</d3p1:value>
      </KeyValuePairOfstringanyType>
    </ErrorDetails>
    <Message>An unexpected error occurred.</Message>
    <Timestamp>2012-11-19T15:55:39.8208026Z</Timestamp>
    <InnerFault>
      <ErrorCode>-2147220891</ErrorCode>
      <ErrorDetails 
          xmlns:d4p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
        <KeyValuePairOfstringanyType>
          <d4p1:key>OperationStatus</d4p1:key>
          <d4p1:value xmlns:d6p1="http://www.w3.org/2001/XMLSchema" 
                      i:type="d6p1:int">0</d4p1:value>
        </KeyValuePairOfstringanyType>
      </ErrorDetails>
      <Message>An unexpected error occurred.</Message>
      <Timestamp>2012-11-19T15:55:39.8208026Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </InnerFault>
    <TraceText i:nil="true" />
  </InnerFault>
  <TraceText>

So what does all of this mean?  Well, as it states, An unexpected error occurred. But what exactly was so unexpected? 

The actual cause can sometimes be hard to track down, but here's a tip:

1. Open the Windows calculator.

2. Set the View to Programmer.

image

3. With the mode set to Dec, for Decimal, past in the ErrorCode found on this line:

<ErrorCode>-2147220891</ErrorCode>

4. Change the mode to Hex. This will convert the number from Decimal to Hexadecimal.

image

5. Select Edit, Copy to copy this value to the clipboard.

6. Open the CRM 2011 SDK help file.

7. Paste the value you copied in Step 5 into the Search box.

8. Remove FFFFFFFF from the value.

9. Click the List Topics button.

10. If that error exists within the SDK, it will probably be found in the topic: Web Service Error Codes.

11. Click once anywhere within the topic window.

12. Press Ctrl+F, for Find.

13. Past the value from the Topic Search box into the Find box.

14. You should be taken to the error code:

image

 

Not all error codes are documented but most are and this technique can really save you time when troubleshooting your code.

Occasionally you run into very strange issues retrieving metadata from a Dynamics CRM organization that has been through an upgrade process.

There are installations in the wild that started with v1.2 or 3.0 then were upgraded to 4.0 then 2011.

For some reason, organizations that went though this process can sometimes have incomplete metadata. I have run across this situation so infrequently that it is hard to pin down exactly what is happening, but it appears that some metadata properties contain a value of null instead of their proper value.

This seems to only appear if the organization was upgraded from CRM 1.2 or 3.0.  If the organization started off CRM 4.0 and was then upgraded to 2011, you should be fine.

I encountered a situation this week while working on a soon-to-be-released CRM documentation tool where the tool was crashing when it retrieved metadata for the Attributes (Fields).

It turns out that the AttributeMetadata.RequiredLevel property was null, when I was expecting anything but a null.

Lesson learned:

When working with CRM metadata, do not assume that there will always be a value in the attribute. Verify that the attribute is not null before attempting to access any of the attribute's properties.  Like this:

if (attribute.RequiredLevel != null &&
    attribute.RequiredLevel.Value == AttributeRequiredLevel.SystemRequired)
{
    return false;
}

 

Thanks to Rhett Clinton for investing the time into helping track this down.

Here's a quick bit of code to help you extract data from a PDF with form fields:

Open the PDF:

var pdfReader = new PdfReader(filename);

 

Read the field names:

var fieldList = GetFormFieldNames(pdfReader);

Read the field names with values:

var fieldList = GetFormFieldNamesWithValues(pdfReader);

 

The code that does all of the work:

private static string GetFormFieldNames(PdfReader pdfReader)
{
    return string.Join("\r\n", pdfReader.AcroFields.Fields
                                   .Select(x => x.Key).ToArray());
}

private static string GetFormFieldNamesWithValues(PdfReader pdfReader)
{
    return string.Join("\r\n", pdfReader.AcroFields.Fields
                                   .Select(x => x.Key + "=" + 
                                    pdfReader.AcroFields.GetField(x.Key))
                                   .ToArray());
}
 

Both of these methods will return a list of fields and possibly values, each separated by carriage return/line feed so that each field is on it's own line.

 

References:

http://stackoverflow.com/questions/4428183/concatenate-a-dictionary-to-a-string-of-key-valkey-val

http://stackoverflow.com/questions/3041883/how-do-i-enumerate-all-the-fields-in-a-pdf-file-in-itextsharp

Sign up for our new KnowledgeBits service and get news, tips and tricks and more, delivered straight to your inbox.