Jul 29
Windows 10 is here. Is CRM ready?

Windows 10 has been released, and Microsoft offered a free upgrade to licensed Windows 7 and Windows 8 users. Windows 10 ships with a new browser called Microsoft Edge, which introduces some great new features and let go of some older capabilities of Internet Explorer. These changes will require CRM to be updated.

What does this mean for your CRM? The Microsoft Dynamics CRM team has been working with the Microsoft Edge team to make sure that Microsoft Dynamics CRM works with Microsoft Edge, which will require CRM to make some updates in order to support the new browser.
The first wave of these update was introduced in CRM Online 2015 Update 1. At this time the following releases of Microsoft Dynamics CRM will provide support for Windows 10, Windows Edge and Microsoft Office 2016:

  • Microsoft Dynamics CRM 2013, Service Pack 1, Update Rollup 4 (version 6.1.4)
  • Microsoft Dynamics CRM Update 0.2 (version 7.0.2)
  • Microsoft Dynamics CRM Online, 2015 Update 1.1 (version 7.1.1)

The above releases are still in development, and we believe a release date is coming out shortly.

Apr 04
Permission accessing SSRS Report Server/Manager

Recently we have encountered an issue where a domain admin (and local admin) account was trying to access the SSRS Report Manager and Report Server web sites and was getting the following error:
User DOMAIN\UserAccount does not have the required permissions. Verify that the permissions have been grated and Windows User Account Control (UAC) have been addressed.

The easiest solution to the problem is to disable UAC on that machine (a restart will be required).
After that you should be able to access to SSRS Report Manager and Report Server web sites.

If you need to keep UAC running, the following KB article details the configuration required for the installation to both install and run SSRS:

Jan 20
CRM 2013 Notes Control Form Presentation

CRM 2013 has a new feature that allows displaying Posts, Notes and Activities within a single control. We can easily add this new control to the form by clicking on the Notes ribbon icon on the Insert Tab of the Form Customization.

It seems that the behavior of adding the Notes control is not always the same, as sometimes the control might display only Notes and sometimes it will display the Posts, Notes and Activities.

The solution as to what the control will display can be modified, by exporting the entity, and modifying the FormXml section of the Entity within the customizations.xml file. Within the FormXml section, under forms type = "main"/systemform there is an element called FormPresentation.

The value of FormPresentation can be either 0 or 1. If the value is 0, only the Notes section will appear. If the value is 1, the Posts, Notes and Activities sections will appear. Make the required changes, re-import your entity/solution and publish your customizations and your form will display the Notes control in the proper way.

Dec 26
Using Multiple User Principal Name Suffixes

When configuring ADFS in your own local the default login of any user authenticating into the environment would be user@domain.local or something of that sort. At many times, especially when working with multiple applications, we would like the user to authenticate using different login credentials such as In order to implement this, we can add suffixes that gives us the ability to user a friendly logon name that is not the same as the domain or parent's domain name.

In order to add a domain suffix to a forest, we need to follow the instructions below:

  • Log on to the domain controller, or a computer that has the different Active Directory Management Tools, and open Active Directory Domains and Trusts.
  • When the application opens, right-click on the Active Directory Domain and Trusts in the Tree window pane, and select Properties from the pop-up menu.
  • On the UPN Suffixes tab, type the new User Principal Name suffix that you would like to add to the existing forest.
  • Click Add and click OK

After the domain suffixes have been added, new users that are added to the domain can select the UPN suffix to use.

Nov 30
Setting the Security Token Expiration for IFD Claims-based Authentication

When configuring Microsoft Dynamics CRM 2011 to your Claims based Authentication a Authentication Required dialog box appears every 20 minutes.
By default the security token lifetime for claims–based authentication deployment using ADFS 2.0 (or above) is 60 minutes, however the token expiration dialog box will appear 20 minutes before the actual expiration.

When the Authentication required dialog box appears, you can either click Sign In, enter your credentials and stay connected to the session (a new security token will be issued). If you have only set Claims based Authentication and not IFD, the re-authentication will happen automatically.
If you click cancel, the token will expire as indicated. When that happens, a new browser session will need to be restarted in order to connect to Microsoft Dynamics CRM. All your data will be lost when the session expires.

In order to change the Token Lifetime from the default 60 minutes to a longer period of time, such as 2 hours or 8 hours, we can use the Windows PowerShell Adfs snap-in to configure this setting.

Follow the steps below to configure the Token Lifetime:

  1. On the Server where you have ADFS installed open a Windows PowerShell prompt
  2. Add the Microsoft ADFS PowerShell Snap-in. If you are running Windows Server 2012 R2, the snap-in is already loaded, so you can skip this step:
    PS> Add-PSSnapin Microsoft.Adfs.PowerShell
  3. Retrieve the Relying Party Token (this step is not required, but it is helpful to see the existing values):
  4. Change the value of the Token Lifetime by calling the Set Relying Part Trust PowerShell Command (the following command will set it to 8 hours (480 minutes):
    PS> Set-ADFSRelyingPartyTrust –TargetName "NAMEOFRELYINGPARTYTRUST" –TokenLifetime 480
  5. Close Powershell, and restart your Microsoft Internet Explorer Session and Connect to CRM. You should now be able to continue working on the application for 8 hours
Nov 01
CRM 2011 Errors with State Code or Status Code is invalid when deleting a managed solution

After importing a managed solution and making changes to the environment by removing some of the out-of-the-box views for the Contact or Account entity, we encounter an error if we ever try to delete the managed solution. The error is "State code or status code is invalid" or 1 is not a valid status code for state code…"

The solution is pretty straight forward. Before trying to delete the solution:

  • Open the default Solution
  • Navigate to the Views of the Account entity
  • Make sure that there are no system views under Inactive Views. If there are, Enable then
  • Repeat the same for the Contact entity
  • Publish your customizations

Now you should be able to delete the managed solution.

Aug 09
What’s New in CRM 2013

With the recent introduction of the next release of Microsoft Dynamics CRM 2013, originally code-named Orion and the new videos that are now available on the Microsoft Partner Training site, the future looks very interesting.

The demos that were provided were impressive and it seems like Microsoft is finally improving on the functionality that has been requested. The new User Experience included in-page experience, easier navigation, dashboards in every module and command bar instead of the ribbon. The User Experience principles that Microsoft has been trying to achieve are Simple, Usable, Modern and Fast.


Focus on the essential functions with a clear, consistent purpose that matches user intention


Measure usability, incorporate feedback into designs


Use appropriate web interpretation of Windows 8 UI to create delightful engaging people and process centric experiences


Design and deliver great perceived performance


Design for Love. Create software that people not only want to use, but simply can't live without


In addition to the enhanced user experience, some of the highlights we were impressed with:

  • Quick View and Quick Create Forms
  • Business Rules
  • Business Process Flows across all entities
  • Real Time Workflows
  • Mobility and Tablet Experience
  • Team Access
  • Modified Data Structure

Additional information and updates are available here


Aug 01
Microsoft Dynamics Online Fall ’13 Licenses

The next version of Microsoft Dynamics CRM, Dynamics CRM 2013, scheduled to be released this fall will include a new licensing scheme.
The hosted product is scheduled for release with three licensing options.

The Professional Edition will cost $65/user/month and will allow users to access the full capabilities of Dynamics CRM. Per Microsoft, this is the licensing option that will best fit most of the users' needs.

The Basic Edition will cost $30/user/month. This edition is aimed at the Sales, Service and Marketing users who need to manage accounts, contacts, leads, cases and access custom applications as well as business analysts that require reporting capabilities.

The Essential Edition will cost $15/user/month, and will provide access to custom (xRM) applications.

Users will be able to mix and match between the three license editions.

Mar 30
Detecting Duplicate Contacts

Although CRM provides a duplicate detection process that can be configured using the User Interface, many time when developing application for CRM, such as Import Manager or Synchronization application, you require to create your own duplicate detection rules, execute the duplicate detection process and retrieve the results of the duplicates from within your application.

The code samples below show how to create a Duplicate Detection Rule, execute the duplicate detection process and retrieve the results of the duplicate records.

To create a Duplicate Detection Rule, we use the DuplicateRule class, and provide a name for the rule and the entity name that will be used for the rule. In the example below, we create a rule that will check for duplicate email addresses in the contact record. After creating the rule, we need to specify the condition for the rule. The DuplicateRuleCondition class allows us to specify the attribute for the condition, and the type of rule that will be used. In the example below we use the emailaddress1 field and the base and matching attribute, and we set the match as exact match (an OptionSet value of 0).

When the rule and the rule condition have been created, we publish the rule by calling the execute method of the CRM service with the PublishDuplicateRuleRequest and PublishDuplicateRuleResponse.

Note that the process to publish a duplicate detection rule can be someone of a lengthy process, so we call the WaitForAsyncJobToFinish method to wait until the job is complete.


private Guid CreateDuplicateDetectionRule()


    DuplicateRule rule = new DuplicateRule()


        Name = "Contacts with the same Email Address",

        BaseEntityName = Contact.EntityLogicalName,

        MatchingEntityName = Contact.EntityLogicalName


    rule.Id = CRMHelper.xrm5.Create(rule);


    DuplicateRuleCondition emailCondition = new DuplicateRuleCondition()


        BaseAttributeName = "emailaddress1",

        MatchingAttributeName = "emailaddress1",

        OperatorCode = new OptionSetValue(0), // value 0 = 'exact match'

        RegardingObjectId = rule.ToEntityReference()




    PublishDuplicateRuleRequest publishRequest = new PublishDuplicateRuleRequest()


        DuplicateRuleId = rule.Id



    PublishDuplicateRuleResponse publishResponse =



    WaitForAsyncJobToFinish(publishResponse.JobId, 60);

    return rule.Id;



The WaitForAsyncJobToFinish method call queries the AsyncOperation entity every 1 second to check if the process has been completed.

Once the process has been completed, the method exits and application can continue processing.

Note that since this is a lengthy process, additional code can be added in case it takes more than the maximum second value.
Normally the 60 seconds passed from the previous method is more than sufficient to create a Duplicate Detection Rule, but at times based on environment, more time will be needed.


private void WaitForAsyncJobToFinish(Guid jobId, int maxSeconds)


    for (int i = 0; i < maxSeconds; i++)


        var asyncJob = service.Retrieve(AsyncOperation.EntityLogicalName,

                jobId, new ColumnSet("statecode")).ToEntity<AsyncOperation>();


    if (asyncJob.StateCode.HasValue && asyncJob.StateCode.Value == AsyncOperationState.Completed)






The CheckDuplicateEmails method shown below is the entry point of the application. The method will first call the CreateDuplicateDetectionRule before proceeding with the running the duplicate detection process. If you already have a Duplicate Detection Rule in your environment, you can skip calling the CreateDuplicateDetectionRule method and the Delete method at the end of the method.
We create a new BulkDetectDuplicatesRequest, passing a job name, query expression that specifies the name of the entity and columns to return, a recurrence pattern and start time. The ToRecipients and CCRecipients are required fields as part of the request (if omitted, process will fail). We call the execute method passing the BulkDetectDuplicatesRequest, and get a BulkDetectDuplicatesResponse class. Since this process is also asynchronous, we will call the WaitForAsyncJobToFinish method passing the job identifier and the amount of seconds to wait.
After the Bulk Detect Duplicates process has been complete we can query the DuplicateRecord entity passing the asyncoperationid field to retrieve a list of all the duplicate contact records that were detected. The method will the return the duplicate identifiers to the calling method.
As previously mentioned, the Delete call should be omitted if you are using an existing Duplicate Detection Rule.


public List<Guid> CheckDuplicateEmails()


    Guid ruleId = CreateDuplicateDetectionRule();


    BulkDetectDuplicatesRequest request = new BulkDetectDuplicatesRequest()


        JobName = "Detect Duplicate Contacts",

        Query = new QueryExpression()


            EntityName = Contact.EntityLogicalName,

            ColumnSet = new ColumnSet(true)


        RecurrencePattern = String.Empty,

        RecurrenceStartTime = DateTime.Now,

        ToRecipients = new Guid[0],

        CCRecipients = new Guid[0]



    BulkDetectDuplicatesResponse response = (BulkDetectDuplicatesResponse)service.Execute(request);

    WaitForAsyncJobToFinish(response.JobId, 120);


    QueryByAttribute query = new QueryByAttribute()


        ColumnSet = new ColumnSet(true),

        EntityName = "duplicaterecord"




    EntityCollection results = service.RetrieveMultiple(query);


    var duplicateIds = results.Entities.Select((entity) => ((DuplicateRecord)entity).BaseRecordId.Id);


    service.Delete(DuplicateRule.EntityLogicalName, ruleId);

    return duplicateIds.ToList<Guid>();



Finally, if we need to use the duplicate identifiers that were retrieved from the CheckDuplicateEmails method, we can use the code below to display them in a grid.
The code sample below uses the Infragistics Grid, but any grid control can be used to display the results.


List<Guid> duplicates = CRMHelper.crm.CheckDuplicateEmails();


if (duplicates.Count > 0)


    foreach (Guid contactid in duplicates)


        Entity contact = CRMHelper.crm.RetrieveContact(contactid);


        int rowid = dgvDuplicates.Rows.Add();

        DataGridViewRow row = (DataGridViewRow)dgvDuplicates.Rows[rowid];

        row.Cells[0].Value = contactid.ToString();

        row.Cells[2].Value = contact.Attributes["fullname"].ToString();

        row.Cells[3].Value = contact.Attributes["emailaddress1"].ToString();




Mar 25
Bulk Data API ExecuteMultipleRequest in UR12

The ExecuteMultipleRequest message was added to the December 2012 Service Update (UR12) in CRM Online and CRM On-Premise, which accepts a collection of message requests, executes them in the order of the input collection and can return a collection of responses that contain the response for each message that occurred or if an error occurred. The CRM SDK version 5.0.13 is required to use the ExecuteMultipleRequest.

Each message request in the collection is processed in a separate database transaction, and the ExecuteMultipleRequest is executed by using the OrganizationService Execute method.

The ExecuteMultipleRequest behaves in the same way as if each message request in the input request collection was executed separately, except that it is processed with better performance. Plug-ins and workflow messages are executed the same way as if each execute message would be called separately.

The sample code below shows how to use the RetrieveMultiple request to retrieve multiple entity records from the database, modify theses records and update them back to the database using the ExecuteMultipleRequest.

The initial step is to instantiate the ExecuteMultipleRequest class so that any updates can be added to the class

ExecuteMultipleRequest multipleRequest = new ExecuteMultipleRequest()
Settings = new ExecuteMultipleSettings()

       ContinueOnError = false,

       ReturnResponses = true


    Requests = new OrganizationRequestCollection()


We then need to retrieve the records from the CRM database that we want to make modifications to, and make the updates. When calling the update method we are not sending the request to CRM, but only adding the update request to the ExecuteMultipleRequest requests collection:

// Retrieve records and make modifications to existing records

EntityCollection contacts = CRMHelper.crm.RetrieveContacts();

if (contacts.Entities.Count > 0)


   foreach (Entity contact in contacts.Entities)


       Guid contactid = contact.Id;

       string emailAddress = contact.Contains("emailaddress1") ?
       contact.Attributes["emailaddress1"].ToString() : "";

       if (!string.IsNullOrEmpty(emailAddress))


          contact.Attributes["xrm_profileurl"] = "" +

          contact.Attributes["xrm_unsubscribeurl"] = ""
             + contactid.ToString();

          UpdateRequest request = new UpdateRequest


             Target = contact


          // Add each updated record to the Multipe Request requests collection





Finally after making the updates to each record, we will call the Execute method on the ExecuteMultipleRequest class to retrieve the responses of all the updates.
We can then loop through the responses to verify that each record update was either successful or failed.

// Execute the multiple requests

ExecuteMultipleResponse multipleResponse = (ExecuteMultipleResponse)CRMHelper.xrm5.Execute(multipleRequest);


// Individual Responses and Faults

foreach (ExecuteMultipleResponseItem responseItem in multipleResponse.Responses)


   string fullname = ((Contact)(multipleRequest.Requests[responseItem.RequestIndex])

   if (responseItem.Response != null)

      Console.WriteLine(String.Format("Contact {0} updates with profile information", fullname));

   else if (responseItem.Fault != null)

      Console.WriteLine(String.Format("Contact {0} could not update. The following error was
returned: {1}", fullname, responseItem.Fault.Message));



1 - 10Next
About this blog
No, this isn't actually my picture. I just haven't gotten around to updating this section. It's good to know that someone is reading every last word though. Thanks!


Like us on Facebook, add us to your LinkedIn network, view our videos on YouTube or subscribe to our blog. Facebook Linked In You Tube Blog and RSS
Powered By SharePoint Online