Wednesday, November 04, 2015

Early Bound Updates Filling the Audit Log

Using early binding with the Dynamics CRM SDK allows you to write type safe code with intellisense reducing the chances of run time exceptions.  However it does have some unintended consequences as every field gets updated and not just the fields that have changed. This can cause the audit history to fill up with unnecessary changes and may also trigger workflows or plugins unexpectedly.

Wednesday, October 28, 2015

Immersive Excel - Accidental Updates

Immersive Excel was introduced in 2015 Spring release of Dynamics CRM and it allows you to bulk edit records using Excel online embedded directly within CRM.  It is a very popular feature and intuitive to use. There is one little caveat in that there is no validation to prevent a user accidently updating a read only field. You will need to write a custom plug in if you want to protect fields from acidential update using Excel.

To bulk edit records in Excel simply select the Open in Excel Online option to edit the current view (you need an Excel online licence for this to work).

Wednesday, May 27, 2015

Business Process Flow Conditional Branching

Dynamics CRM 2015 business process flows now support conditional branching and in the process designer you now have the option to add a conditional branch to your process.

Monday, April 20, 2015

Quick Find - PlugIn to modify the search

The Quick Find functionality in Dynamics CRM allows users to quickly search for records. The Quick  Find view for each entity is used to customize how the records are filtered for searching. Typically the filtering criteria restricts the searching so that only records owned by the current user are returned.

 A common request from users is the ability to extend the records to be searched. In this post I am going to show how a custom plugin can be used to modify the search’s filtering criteria on the fly. This is a simple example however it can easily be extended to cover other scenarios. The Account Quick Find view filter is configured to search active records where the owner is the current user.

Wednesday, March 04, 2015

The Implications of Cascading Ownership

When a user changes the owner of a record in Dynamics CRM they can be surprised by what happens to its related records. By default assigning a new owner to a record also changes the owner of all its related records and all their activities. This includes completed activities.

This is because the default behaviour for parental relationships is to cascade the action on a parent to all its related records. If we look at the number of parental relationships for the account entity you start to get an indication of how much cascading can happen and the potential performance impact. In particular the impact of a Parent Account and the number of related contacts.

Wednesday, February 11, 2015

Real Time Exchange Rates using a Calculated Field in Dynamics CRM

Each currency field in Dynamics CRM actually consists of three fields the currency amount, the base currency amount  and the exchange rate. When a record with a currency field is saved the corresponding amount in the system's base currency is calculated using the current exchange rate and all three values are saved.

While this is fine for some scenarios where you want to stamp and lock the FX rate on the record it is not appropriate in others. A typical scenario is when you have multi currency opportunities and you want to report on these using the latest exchange rate. If you use the base amount then you will get the base currency value at the time the record was saved. Prior to the release of Dynamics CRM 2015 using the current exchange rate was difficult to achieve without custom code.

Sunday, January 18, 2015

Maintaining Team Membership in Private Queues with a Plugin

The Spring 2014 release of Dynamics CRM introduced private queues prior to this all queues were public and visible to all users. Now you can control which users can see a private queue by adding them as members of that queue. When adding members to a queue you have the option to add a team in which case the team members are added as members of the queue.  The problem is that any subsequent changes in the teams membership are not reflected in the queues membership.

Setting Field Visibility when the Business Process Stage Changes

In Dynamics 2015 we can now hook into the OnStageChange event which gets fired when the stage of a business process flow changes. We do this by adding an event handler to the OnStageChange event when the form loads. In this example when the form loads it calls the AddStageHandlers function so that the StageChangedHandler function gets called when the stage changes.

Dynamics CRM Form

When the StageChangedHandler function runs it checks if the opportunity is at the "Close" stage. If the stage is Close then the header field estimated value field is disabled so that the Estimated Revenue cannot changed. It also hides the purchase timeframe field.

  1. function AddStageHandlers() {
  3. }
  5. function StageChangedHandler() {
  6.     var activeStage =;
  7.     var stageName = activeStage.getName();
  8.     if (stageName == "Close") {
  9.         Xrm.Page.ui.controls.get("purchasetimeframe").setVisible(false);
  10.         Xrm.Page.ui.controls.get("header_estimatedvalue").setDisabled(true);
  11.     }
  12. }

Dynamics CRM Opportunity

Sunday, January 04, 2015

CRM Queue with a Office 365 Shared Mailbox

If you use Office 365 then the best option for CRM email queues is to use a shared mailbox as they don't consume a license and there is no charge if they don't exceed 5gb in size. Below is an example of the steps required to create a support email address and the associated queue in Dynamics CRM.

In the Office 365 admin portal select the new option under shared mailboxes and enter your desired email address with at least one member. Note: You must enter a member against the mail box otherwise it will not be provisioned.  You can remove the member once it's working.