Hosk’s Top CRM 2013 articles of the week 9th May 2014

I had two interactions with readers of my blog this week

one person was criticizing a blog post written in December 2011, saying the title wasn’t very good and I should include some pictures.  This was fair enough and I’m all for constructive criticism and the blog post did look a bit boring but it did also resolve his problem.  The blog post is how to add code in WordPress blogs


Then the person went to far and said I should change the title of the blog because Hosk’s Dynamic CRM Blog was boring.  Woah there tiger, step back and leave the Hosk name alone there big boy.

The second interaction was more positive, he said he liked the weekly round up because he didn’t have enough time to keep up with all the blogs being written.  This highlights the reason I Hosk’s weekly picks.

I want to list the really good/useful articles I read in the week.   I only want to list the good ones, so some weeks it’s a big list and other weeks there is a small list.


If you come across any good blog post please email me or or tweet the link and mention and add my twitter account @BenHosk, thanks to Bartłomiej Steidel for recommending a couple of good CRM blogs this week.

I wasn’t really sure people liked the my weekly round up but it seems people do enjoy me scurrying around collecting great CRM articles for them to read on a Friday.
Lets bring some postivity into this weekly round up, thumbs up people

Article of the week

This is a great blog post about Auto Save, it shows you how it works and ways to interact, turn it off and a few gotcha’s.  This article seems to collate many articles I have read on auto saving into one handy blog post.

All you want to know about Auto Save


It’s a bumper crop this week

The Best of the Rest

Service pack 1 is choc full of fixes

Microsoft Dynamics CRM 2013 Service Pack 1 (SP1) will be available in the second quarter (Q2) of 2014


Microsoft Support give us a sneaky trick to make fields appear in the bulk edit window, very useful

Dynamics CRM Parent Account lookup field is greyish in bulk edit


working out what sql querys are generated from your CRM FetchXML queries

Use SQL Tracing to find the SQL query generated for Dynamics CRM Platform Operations for CRM On-Premise


Microsoft have finally made CRM 2011 compatible with Windows 8 and IE11

CRM 2011 – Rollup 17 – IE11 is now compatible with CRM 2011


This is a question that pops up regularly on the CRM forum, so it’s good to have an answer to it.  It’s also not something I do very often, so it’s good to have a step by step guide.

How to Import Marketing List Members in Microsoft Dynamics CRM


if you have ever raised a support call, you will have had to run the support diagnostic tool, this article explains why

Support Diagnostics Tools


A good article from Robert Peledie, he has been on good form on the last few weeks, so keep up the good work Mr P.  This article shows you how you can override the created on date, this can be very useful thing to know

Override The Created On Date on Import


The marvelous Dave Berry is in the firing line and rises to the challenge like an Eagle on Red Bull

CRM MVP Question and Answer – Dave Berry


Every time I create a new entity, I stop for a few minutes to debate the question, should this entity be user owned or organisational.  Knowing that once you press the button you can’t go back and change it, ramps up the pressure.  So let this article guide you on that subject.

User-Owned or Organization-Owned Entities?

A blog post by the Hosk, going through creating a plugin which is triggered after a new account is created, we created a follow up task.  It’s simple, it will only take you twenty minutes.

CRM 2013 Plugin – Step by Step guide for a Post Account Create Plugin using the Developer Toolkit


I wasn’t sure about Access Teams, I understood you create them to give quick and ad hoc access to a record but never really understood why I would do that and for what scenario but as I read more articles on the subject I am slowly seeing the benefits e.g. access teams don’t use the POV table!  Good article, I will also be going through this soon for my MB2-703 – CRM 2013 customization and configuration studying.

Microsoft Dynamics CRM Owner Teams vs Access Teams

Did you know that if you own a workflow and disable your user the workflow will refuse to work, well you do now.

Workflow ownership and disabled users

Hosk goes through the process of creating a dialog and don’t be fooled by the title, dialog’s are not easy they are odd, like an upside down workflow

CRM 2013 – Simple Dialog with a CRM Query

cheeky little trick on how to set a bookmark in IE which pops up an alert of the record you are on.

Retrieving a Record’s GUID in Microsoft Dynamics CRM 2013

Article from CRM MVP Scott Durow the creator of the mighty Ribbon Workbench.  This article shows you how to create a command bar button if you create a new entity and you tick the activity checkbox.  This article is useful just to show you how to use the Ribbon Workbench which can take a little bit of time to get used to (because there are so many options)

Create a command bar button for your custom activities

A dev tip, also add Id to lookup fields in CRM.  Everyone else is doing it and so should you.

Hosk CRM Dev Tip – add ID suffix to lookup fields

You may have heard me waffle on about Badges before but you could be collecting lots of badges to boast to your CRM buddies about.  Microsoft could tweeting about your new level upgrade.  There are also some good screens hidden away to show your ranking on answering forum questions

What are Microsoft Dynamics Community Badges and how to get started collecting them

Creating a no code approval process in CRM 2013 using lots of new CRM 2013 functionality



A useful tool for showing pins on bing maps
Dynamics CRM Bing Map custom Chart


This is a very cool tool by kingswaysoft,  it will convert SQL statements into FetchXML. WOW




a video for those studying for the MB2-703 – CRM 2013 Customization and configuration exam
CRM 2013 – MB2 703 – Manage user access, Teams and sharing


learn some more about access teams

Microsoft Dynamics CRM 2013 Application New Features – Access Teams


If you want more great articles, why not go back and read last weeks top CRM articles again, did you read them?



if you find reading to difficult today, why not go and watch some CRM videos on my youtube channel

Hosk’s CRM Dev

CRM 2011 – Rollup 17 is Released – CRM 2011 is now compatible with Windows 8.1 and IE11

a new rollup for CRM 2011 has been rolled out today and now before you all go rushing off to install it.  I would remind you best practices regarding rollups is to stay one rollup behind, this is to help ensure you don’t install a rollup for then someone to find a great big bug in it.

Unless there is a fix you need urgently of course.

It’s good to see CRM 2011 is now compatible with IE 11

First things first here is the download link


Microsoft add an Important Note which you can see on the kb article – http://support.microsoft.com/kb/2915687

important Note: Microsoft Dynamics CRM 2011 Update Rollup 17 is compatible with Windows 8.1 or Windows 7 and Internet Explorer 11. This includes the following supported configurations.

  • The web application running in Internet Explorer 11 on Windows 8.1 or Windows 7.
  • CRM for Outlook when you run Office 2013 on Windows 8.1.

I would also note there is a hotfix which needs a bit of manual wangling, text taken from KB article

Hotfixes and updates that you must enable or configure manually

Update Rollup 17 for Microsoft Dynamics CRM contains one fix that must be enabled manually.

  • When you attempt to deploy a mailbox rule using the forward mailbox rule deployment wizard, with a split deployment for Exchange 2010 where your mailbox servers are not client access servers, you receive an error: Failed to access the default store for the user.
    1. On the Email Router machine, you must create a new String value Key named “CASServerName” in the path HKEY_Local_Machine\Software\Microsoft\MSCRMEmail.
    2. Enter the NetBIOS name of one of the Exchange CAS servers.


There is a lot of fixes in this rollup, so go to the KB article to see if there is a particularly bug that is fixed.  I couldn’t see anything to get really excited about, apart from IE 11  support and maybe CRM 2011 won’t crash as often.


CRM 2013 Plugin – Step by Step guide for a Post Account Create Plugin using the Developer Toolkit

In the I have created a video if you want to watch me go through the process of creating the plugin. Before I start with this plugin tutorial, to understand it you will need to have gone through my previous tutorials I have three CRM videos and two blog posts

Setting up Developer Toolkit for Microsoft Dynamics CRM

blog – Setting up visual studio with the developer toolkit

video – CRM 2013 – Create a simple plugin in CRM 2013 using the CRM Development Toolkit 

blog – CRM 2013 – simple update plugin

CRM 2013 – Simple Plugin – Redeploying, improving and updating

So I will assume you have got CRM development toolkit setup and ready to rock, so now we can just focus on creating a new plugin to run on the create of an account record In this plugin we are going to create a plugin which is triggered when a new account is created.

Here is a video going through the steps

below features the steps and the code

The plugin will fire after the new account is created so it will be a post plugin message.

The plugin will then create a follow up task with a due date in two weeks time.

Open up your Visual Studio project.

Go to the CRM Explorer

click on Account right click and choose Create Plug-in

Create Account Plugin


For the Create Plugin Details, Account is already set but you want to

change Message to Create

Pipeline stage to Post-Operation

Create Account Plugin 1


This will Create a file called PostAccountCreate.cs  For this plugin I have split up the default plugin code and the code which does the creating of the task.


// <copyright file="PostAccountCreate.cs" company="Microsoft">
// Copyright (c) 2014 All Rights Reserved
// </copyright>
// <author>Microsoft</author>
// <date>4/26/2014 10:42:26 PM</date>
// <summary>Implements the PostAccountCreate Plugin.</summary>
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1
// </auto-generated>
namespace HoskCRMDev2013.Plugins
 using System;
 using System.ServiceModel;
 using HoskCRMDev2013.Plugins.Plugin_Code;
 using Microsoft.Xrm.Sdk;

 /// <summary>
 /// PostAccountCreate Plugin.
 /// </summary>
 public class PostAccountCreate: Plugin
 /// <summary>
 /// Initializes a new instance of the <see cref="PostAccountCreate"/> class.
 /// </summary>
 public PostAccountCreate()
 : base(typeof(PostAccountCreate))
 base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Create", "account", new Action<LocalPluginContext>(ExecutePostAccountCreate)));

 // Note : you can register for more events here if this plugin is not specific to an individual entity and message combination.
 // You may also need to update your RegisterFile.crmregister plug-in registration file to reflect any change.

 /// <summary>
 /// Executes the plug-in.
 /// </summary>
 /// <param name="localContext">The <see cref="LocalPluginContext"/> which contains the
 /// <see cref="IPluginExecutionContext"/>,
 /// <see cref="IOrganizationService"/>
 /// and <see cref="ITracingService"/>
 /// </param>
 /// <remarks>
 /// For improved performance, Microsoft Dynamics CRM caches plug-in instances.
 /// The plug-in's Execute method should be written to be stateless as the constructor
 /// is not called for every invocation of the plug-in. Also, multiple system threads
 /// could execute the plug-in at the same time. All per invocation state information
 /// is stored in the context. This means that you should not use global variables in plug-ins.
 /// </remarks>
 protected void ExecutePostAccountCreate(LocalPluginContext localContext)
 if (localContext == null)
 throw new ArgumentNullException("localContext");

 // TODO: Implement your custom Plug-in business logic.
 // Obtain the execution context from the service provider.
 IPluginExecutionContext context = localContext.PluginExecutionContext;
 IOrganizationService service = localContext.OrganizationService;

 // The InputParameters collection contains all the data passed in the message request.
 if (context.InputParameters.Contains("Target") &&
 context.InputParameters["Target"] is Entity)
 // Obtain the target entity from the input parmameters.
 Entity entity = (Entity)context.InputParameters["Target"];
 if (entity.LogicalName == "account")
 if (context.MessageName.ToUpper() == "CREATE")

 AccountCreateFollowUp accountCreateFollowUp = new AccountCreateFollowUp();
 accountCreateFollowUp.CreateAccountTask(service, entity);


The code above checks to see if the entity is of type account and if the message is a CREATE message. This is in case you had the same plugin being fired on lots of different account messages (e.g. create, update, status change).  We aren’t really using it in this plugin but I thought it would be interesting to mention it.

The code which creates the task is called here

AccountCreateFollowUp accountCreateFollowUp = new AccountCreateFollowUp();
accountCreateFollowUp.CreateAccountTask(service, entity);

Below you can see the class which creates the followup task

using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk;

namespace HoskCRMDev2013.Plugins.Plugin_Code
 public class AccountCreateFollowUp
 /// <summary>
 /// Code to create account task for new accounts
 /// </summary>
 /// <param name="service">crm service</param>
 /// <param name="accountEntity">entity of the newly created account</param>
 public void CreateAccountTask(IOrganizationService service, Entity accountEntity)

 //create new task for account set in 2 weeks in the future
 Entity contactAccountTask = new Entity("task");
 contactAccountTask["subject"] = "Check new account is happy";
 contactAccountTask["description"] =
 "Make contact with new customer. See if they are happy with service and resolve any issues.";
 contactAccountTask["scheduledstart"] = DateTime.Now.AddDays(14);
 contactAccountTask["scheduledend"] = DateTime.Now.AddDays(14);
 EntityReference entRef = new EntityReference("account", accountEntity.Id);
 contactAccountTask["regardingobjectid"] = entRef;

 // Create the task and this should be linked to the new account record


 catch (FaultException ex)
 throw new InvalidPluginExecutionException("An error occurred in the plug-in.", ex);



Now right click on CRMPackage

click build

Click Deploy