Monday, October 22, 2012

Microsoft.Crm.LocatorService Exception when Installing UR10 or UR11 on Client

When installing update Rollup 10 or Rollup 11 for your Microsoft Outlook CRM Client, you can come across this error:

“The type initializer for 'Microsoft.Crm.LocatorService' threw an exception.
Cannot load Counter Name data because an invalid index '' was read from the registry.”


This is not a bug in the rollups, it’s the pointers to the performance counters that are corrupted on your computer and they must be rebuilt.

Step-By-Step

1. Go to Start, write ”cmd”.

2. Right click on cmd.exe and choose ‘Run as administrator’.

3. Write “lodctr /r” and press enter.

image

You will then get the message ‘Info: Successfully rebuilt performance counter setting from system backup store’.

4. Check if there are providers that are disabled, write “lodctr /q” and press enter

image

5. You will then get a long list of providers, make sure that the [CRM Client] is Enabled, se below

image

If not, write “lodctr /e:CRM Client” and press enter.

image

6. Install the Outlook client rollup, 10(v2) or 11.

Done.

Thursday, October 4, 2012

Get Linked Entities Attributes in Plugins

Somehow, I have always managed with QueryExpressions in my plugins. I have never (!!) used FetchXML to get data in plugins before, only in JavaScript.
One really nice thing you can do with FetchExpression, that you can’t with QueryExpression, is to get a linked entity’s attributes in the response. Sweet.

Here’s a simple code example on how to do this
  
 EntityCollection entityColl = new EntityCollection();
 FetchExpression fetchEx = new FetchExpression(
        @"<fetch mapping='logical'>
                    <entity name='new_contract'>
                         <attribute name='new_name' />                                  
                         <attribute name='new_contract_number' />
                                 <filter>
                                   <condition attribute='statecode' operator='eq' value='0' />
                                 </filter>
                                 <link-entity name='contact' from='contactid' to='new_contact_id'>
                                             <attribute name='emailaddress1' />
                                 </link-entity>
                    </entity>
          </fetch>");
 
 entityColl = serviceProxy.RetrieveMultiple(fetchEx);
 if(entityColl.Entities.Count > 0)
 {
         string contractName =  entityColl.Entities[0].Attributes["new_name"].ToString();
         string contractNumber = entityColl.Entities[0].Attributes["new_contract_number"].ToString();
         AliasedValue aliasedContactEmail = (AliasedValue)entityColl.Entities[0].Attributes["new_contract1.firstname"];
         string contactEmailAddress = aliasedContactEmail.Value.ToString();
         //Do something useful with the result
 };

Friday, August 24, 2012

Security Permissions when Setting Up CRM 2011 Outlook Client

Ever got this error when you are trying to set up CRM in your Outlook?
image

Then make sure your Security Role has READ on the following:

Tab – Core Records

Web Wizard Access Privilege
Web Wizard
Wizard Page

Tab - Business Management

User Settings
User
Organization
Team
Security Role

Tab - customizations

Sdk Message
View
System Form
Customizations
Solution
Publisher
Sdk Message Processing Step
Sdk Message Processing Step Image
Plug-in Assembly
Web Resource
Web Resource – create privileges

Wednesday, August 22, 2012

Be More Effective by Adding Entities as Favorites in The Outlook Client

Let’s face it. It’s annoying reaching the entities you work with in the Outlook Client. If you add the entities as favorites, CRM becomes much more user friendly.

image

Step–By–Step

1. Close Outlook
2. Open the Registry Editor
3. Find HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient
image
4. Create a new key of type DWORD32 with name DisableSolutionsModule
image
5. Change the value to 1 (right click the key and select Modify)
image
6. Start Outlook and drag and drop the entities to Favorites
image

And as always, be careful when you are in the Registry Editor. If you are too creative you could end up having to reinstall the operating system.

Monday, August 13, 2012

Friday, July 13, 2012