CRM 2015 – How to set focus in Javascript

I wanted to set focus in Javascript after a user had changed a field to yes, this triggered an onchange event.  The onChange event set a new tab to be visible.

The new tab was below and the users didn’t always know it was there, so I wanted to nudge them in the right direction by setting focus on the tab.

Microsoft has added a great framework for manipulating the controls.  The Javascript for setting focus works on the Control level



This blog post has a great page, it highlights the functionality available in the CRM SDK, displaying the logical structure of the JavaScript wrapper created for development

Microsoft Dynamics CRM 2013: Client API Enhancement


Different Versions

It’s important to check the CRM SDK XRM documentation because each release of CRM adds and removes functions.

Xrm.Page.ui control (client-side reference)

The CRM SDK documentation shows the functionality available for each release by selecting the CRM version in the drop down at the top of the page.

Javascript versions

When you select a different version it will change the methods available.  This enables you to see what functionality is available for each version and what new functionality has been added.

Hosk’s Top CRM Articles of the week – 20th November

I moved job this week and start my new role at KPMG Crimsonwing.  I noticed they are presenting at Convergence 2015, awesome.

Fasinating fact

What is the difference between raisins, currants and sultanas?

  • Raisins     = any dried white grapes
  • Currants  = dried Black Corinth (also known as Zante)  grapes
  • Sultanas  = dried white seedless grapes, originally from Turkey. Usually Thompson Seedless variety.


The first principle is that you must not fool yourself and you are the easiest person to fool.

Richard P. Feynman

If you can’t explain it simply, you don’t understand it well enough.

Albert Einstein

Article of the week

There were 3 great tools released in the last week

XrmRichTextEditor component released

This tool adds a rich text editor, which is useful

Introducing the Alexander Development Dynamics CRM Configuration Data Mover

This tool is great, it allows you to move data between your CRM organisations and keep the same guid.  This is useful if you have workflows which use custom entity records.

D CRM Editable Grid

An editable grid, which a lot of end users like.

Best of the Rest

CRM 2015 – What developers need to know about the activity entity

In-depthh article on the Activity entity, otherwise known as ActivityPointer

Dynamics CRM as an xRM Development Platform

Great article discussing why CRM is a great XRM platform

CRM 2013 – Remote Debugging

How to remote debug CRM 2013 on premise plugins.

CRM Web API Using C#

A run through of the Web API using C# from CRM MVP Jason Lattimer

CRM 2011 – How to set an attribute label in Javascript

It’s possible to get the a field’s label using JavaScript

When to automatically change fields using Javascript

Some tips from Hosk about when to change fields using JavaScript.

All About Activity Entity Query Full Guidance in CRM 2011/2013 : Basic–Complex (ActivityPointer, ActivityParty) Queries in One Post

Indepth article on activity entity and SQL queries.

Video: 8 Great Techniques to Assure a Smooth Migration to Dynamics CRM 2015

8 tips delivered by a very happy sounding lady.

Get the Entity Type Code using JavaScript only (not using remote services)

Interesting but unsupported trick to get the entity type code

ExecuteMultiple & Workflow or Plugin Assemblies

Execute Multiple is useful if you plan to update lots of records but it does roll them all back if there is an error.

CRM 2013 – Understanding Auditing, Tips, Tricks and Gotchas

Microsoft unveils German data plan to tackle US internet spying

Microsoft Adds a new EU data centre.

Permissions Issues for CRM 2013/2015 Forms

form permissions

CRM 2013 – When using FetchXML is better than OData

FetchXML has useful functionality like distinct

Tip #517: Disabled user’s personal views

How to disable users personal views


Some advice about using Dialogs

Understanding Auditing in CRM 2013


Most developers have never seen a successful project

Great story of message flaky tests

Scrum is the new waterfall


Learn about Elon Musk

The Cook and the Chef: Musk’s Secret Sauce – Wait But Why

How Tesla Will Change The World – Wait But Why

Why Early Decisions Have the Greatest Impact and Why Growing too Much is a Bad Thing

Why you should read

Shane Snows reading list

5 Real-Life Salary Negotiations (And What You Can Learn From Them)

Previous top picks

Hosk’s Top CRM Articles of the week – 10th November

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things

CRM 2013 – Remote Debugging

Only those who dare to fail greatly can ever achieve greatly.”

― Robert F. Kennedy

Developer fear

When I was a junior CRM Developer I couldn’t get remote debugging working, Visual studio wouldn’t attach, port problems etc.  I gave up because I need to resolve the problem.

Until I have done something I’m not sure I can get it working.

The mind makes unknowns scarier; it exaggerates and focuses on worse case scenario’s. Like visiting somewhere you have never been before such as you first day at school/university.  The location seems bigger and shrinks in size with familiarity.

Remote debugging is frustrating because to find out why a customization is erroring you need to debug it.

One day I came to work determined to get remote debugging working and after half a day of trying I got it working.

When using a tool or functionality for the first time, you are outside of your comfort zone (How to cope when you are out of your Developer comfort zone)

Why we need a CRM Developer toolkit

It’s important the CRM developer toolkit is updated and works with CRM 2015/Visual studio 2015.  The CRM developer toolkit makes it easier new CRM developers to write, update and deploy plug-ins.  We don’t want barriers for new CRM developers we want to encourage them to join the CRM development community.

Remote debugging considerations

Remote debugging has some drawbacks, if the plugins has isolation mode = “none” you use the CRM async service, W3p.exe.  This stops the CRM server  processing system jobs, other users have to wait until you have finished debugging.  This is frustrating for other developers because it stops them using CRM.

A better alternative is to test your code using unit tests or console app if I want to call it with data in CRM, this has no effect on other developers and units tests can be rerun by any developer.

Most scenario’s you can test your logic without using the remote debugger, Why CRM Developers should unit test their code

I wrote about remote debugging for CRM 2011 before

CRM 2011 – how to set up Remote debugging for plugins

If you experience problems setting up the remote debugger, try this blog

Remote Debugging CRM 2011 Plugin

Learn Remote debugging before you need it

It’s better to learn a process, new functionality before you use it for the first time on a project,

Make mistakes in practice, it’s a less stressful place to learn than on a live project

Get experience remote debugging before you need to use it.

Remote debugging can be a frustrating due to difficulties in setup and configuration.

Remote debugging is on for On Premise CRM only

You cannot remote debug CRM online.

To debug plugins deployed on CRM Online, you have these choices

The purpose of remote debugging is to test the logic.  You can recreate the scenario from in dev by recreating the data.  Remote debugging shouldn’t be the first tool when diagnosing a problem, it can affect performance and other developers

  • Unit Test
  • Console app and Test plugin code
  • Plugin Registration tool

The debugging option work with CRM On Premise but you cannot use the remote debugger with CRM online.

You can unit test code and create a connection for IOrganisationService to your online CRM and pass and then run unit tests.

Console App

Create a console application, connect to your CRM online and test the code, mimicking the plugin.

Plugin Registration tool

The plugin registration tool can debug the code, it has the advantage of not freezing the whole server because it works with CRM on premise and CRM online.

This video has a good walkthrough of the process Debug CRM Online Plugins

CRM 2015 has added plugin tracing, read more about it here and here

Remote debugging steps

The process is the same for CRM 2011, CRM 2013 and CRM 2015 plugins.  Custom Workflows are different, this blog post walks through the process – Debugging Workflow Custom Activities with Plugin Registration Tool

In this blog post I focus on using the remote debugger and a plugin

I’m using CRM Developer toolkit and running the remote debugger, you can run it as a service which runs all the time (called Remote Debugger) or you can run it as application. which starts when you need it.

Running as a service is it’s always running and can be set to auto start on server reboots.

The downside is the remote debugger service will always be running and taking a bit of server memory/processing (although not much).  You can stop the service if you need.

Developers should use remote debugging in a development environment.

Build the plugin

Copy the plugin/custom workflow .dll and .PDB files to the CRM server directory

C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly

If you haven’t installed CRM on the C drive then you need to look for it on another drive

The DLL’s and PDB copied to the server must contain the code you want to debug in Visual Studio.  If the code on your local machine is different from the deployed plugin you won’t be able to debug

Important – Copy the .dll and .PDB files to C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly

Important 2 – Any dependencies in your plugins (dll‘swhich are not in the GAC need to be copied to the server as well.

I copied the PDB files here

C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly

What is a PDB file?

You may be wondering what a PDB file is, my knowledge of them is you need them for debugging and they contain the code you have written where as the DLL has the compiled code. 

Wiki describes PDB file as

PDB stands for Program Database, a proprietary file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE). PDB files commonly have a .pdb extension. A PDB file is typically created from source files during compilation. It stores a list of all symbols in a module with their addresses and possibly the name of the file and the line on which the symbol was declared. This symbol information is not stored in the module itself, because it takes up a lot of space.

A PDB is needed for debugging, it isn’t needed when you deploy your plugins or custom workflows.

recap of steps

  • Ensure the remote debugger is running as a service or application
  • Build the plugin
  • Deploy the plugin
  • copy the DLL and PDB to the CRM server folder
  • C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly

Attaching the process

You should be ready to attach Visual Studio to the process and wait for the code to be trigger and your visual studio breakpoint to be hit.

Set a breakpoint in the plugin, put the breakpoint at one of the first lines to avoid breakpoints not being hit because their code was either erroring or not being triggered.

Press the Attach button

remote debugger attach

Brings up this page, it will default to your local machine but you need to put in the name of the CRM server and the port used in the remote debugger.

If my port was 4016 and the CRM server was called CRM server.

CRM Server:4016

Remote Debugging 3

Make sure you tick Show Processes from all users, if you don’t you won’t be able to see the CRM services because  they are most likely run as a different user.

If you don’t know your port number, you can go to the CRM server, open the Remote Debugger to find the path of the application

Remote Debugging 1

click on msvsmon and it will error and tell you the port number you are using.

Remote Debugging 2

When you put in the correct CRM server and port number, the services running will be listed.

If you plugins are in the sandbox (Understanding Plugin sandbox mode) you need to attach the to the process Microsoft.CRM.Sandbox.WorkerProcess.

remote debugging

Usually there are multiple Microsoft.CRM.Sandbox.WorkerProcess. This is because you get one for each CRM web page.  It’s difficult to work out which process is the process you want to debug, so I usually select all of the Sandbox WorkerProcesses to ensure I debug my process.

The final stage is to trigger the plugin and debug your plugin.

Good luck

CRM 2015 – What developers need to know about the activity entity

Microsoft Dynamics CRM has different Activity entities, showing actions from the CRM users.  ActivityPointer records are automatically created when an Activity record is created, enabling developer to retrieve different Activity types with one request.

If you don’t understand how to use the ActivityPointer record you can quickly get bogged down trying to retrieve individual Activity types.

CRM developers should think in entities when designing CRM solutions, activities track the activity and effort of the people using the CRM Solution.

Activities are the actions users do in CRM, often tracking the interaction between users and customers.

CRM has lots of different activities

  • PhoneCall
  • Task
  • Letter
  • Email
  • Appointment
  • Fax
  • Custom Activities

Tracking the activity of users/customers, records the time spent on CRM records. For cases, you can see activities associated with the case.   Tracking activities allows different people to work a record with a full knowledge of the status of the case.

Activity facts

  1. Activity is an entity in CRM, you can look at it in the custom solution
  2. The activity entity is non-editable.
  3. Activity schema name is ActivityPointer e.g ActivityPointer = Activity
  4. ActivityPointer is not the same as Activity Party

Microsoft ActivityPointer description

“Task performed, or to be performed, by a user. An activity is any action for which an entry can be made on a calendar.”

What’s the purpose of the Activity Entity?

If you can’t explain it simply, you don’t understand it well enough.

Albert Einstein

To understand a CRM functionality, you need to understand its purpose.   Once you understand what it’s used for, how it works and why it works in that way.

CRM developers should Start with the CRM SDK and then explain it to yourself in your own words.

The purpose of the Activity entity is in the schema name – ActivityPointer.  Developers can retrieve all activities with one request, instead of multiple retrieves using the different activity types.

The activity views allow you to show all activities for a record, despite the activities being different types (e.g. Email, PhoneCall, Task)

The CRM SDK has a great page on Activity entities.

The diagram shows why understanding Activities is important, Activities are linked to the primary entities in CRM.  Activity entity acts like an interface between primary entities and individual activities.

Why do you need to know ActivityPointer?

ActivityPointer is a generic, it holds links to all activities.  You gain the ability to retrieve all Activities but lose the ability to retrieve individual fields or custom fields on the different Activities.

The alternative would be to have a Sub-grid for each different activity type!

activitypointer views

The ActivityPointer is a wrapper or interface to all activities, it includes the generic fields found on all activities.  Microsoft ensures activities have common fields by making you tick the activity checkbox when creating an activity entity.


ActivityPointer.ActivityId will have the same value as the Activity its wrapping.  Using the example of an Email activity.

Email.ActivityId will have the same value as the ActivityPointer.ActivityId

activitypointer view

activity pointer email fetchxml

Doing an advanced find for Activities, when you click on an Activity record it will open the Activity, e.g. click on Activity record of type email, it will open the email.

ActivityId’s are the same because an Activity record is created by CRM when an activity record (Task/PhoneCall/Email/etc) is created.

Activity Types

Doing an advanced find, you can use the Activity Type field on the ActivityPointer entity to see what Activites types can be ActivityPointer records.  The Activity Type is a Global option set

activity type

Activity Type – activitypointer_activitytypecode

activity type 1


There are lots of activity types which don’t look like regular activities, such as

  • Bulk Operation
  • Case Resolution
  • Opportunity Close

CRM creates activities when a Case/Opportunity is closed but why don’t these activities appear in the Activity views?

The field IsRegularActivity on the ActivityPointer entity is set to no for CRM created Activities.

If you search for all Activities you can view the non-regular activities, I mainly had Case Resolutions


Custom Activities

When creating a custom entity you can specify if the entity is an activity by checking Define as an Activity entity

activity checkbox

I have discussed this in detail in this blog post below

CRM 2013 – When should you create a custom activity entity?

Think about the security limitations of creating Custom Activities, e.g. Any security settings will be applied to all activities. It’s unlikely you want any security on activities because most users need to read and create activities.

Important facts to remember when creating Custom Activities

  • Custom Entities when created by default are not viewable/usable to any users apart from System Administrator and System customizer roles. Other security roles will have to add the entity (don’t forget)
  • If an entity is selected as an Activity this cannot be undone
  • Custom Activity entities are available to users who have access to other Activity entities

I have worked on a project where security concerns meant the custom Activity was converted to a standard entity. We created a custom entity (Which you can apply security too), copied the data into your new entity, deleting the custom Activity.

Activity and SQL

ActivityPointer entity has an SQL table and Filtered view () created on the CRM database.

  • Table – ActivityPointerBase
  • Filter – ActivityPointer

Tables in the CRM database allows you to create reports using Activities.  Best practise is to use the ActivityPointer filter,  why filtered views are useful

The blog post does an excellent job explaining Activity entity with SQL.

All About Activity Entity Query Full Guidance in CRM 2011/2013 : Basic–Complex (ActivityPointer, ActivityParty) Queries in One Post

Activity coding problem

I needed to reactivate a case and reactivate the last Activity for the case.

The existing code activated Tasks but now I needed to activate Tasks and PhoneCalls.

Developer assumptions cause many bugs.  Functionality should work how the user wants it to work, not the developer, remember You are not the end user

I needed to check all the activities for the case and reactivate the last PhoneCall or Task activity.  Task and PhoneCall had a custom field which indicated if the Activity should be reactivated.

The custom field increased the complexity, ActivityPointer record doesn’t contain the custom field because ActivityPointer contains generic fields common on all Activity records.

My plan

  • Retrieve all the Activities using ActivityPointer
  • Loop through Activities, checking if the Activity was of type PhoneCall or Task
  • Use Activity.ActivityId to retrieve the Activity

Here is Linq query I used to retrieve ActivityPointer

        public List<ActivityPointer> GetRecentActivityForIncident(Guid incidentId)
            this.tracingService.Trace("Enter Method GetMostRecenActivityForIncident");
            using (OrganizationServiceContext crmContext = new OrganizationServiceContext(this.crmService))
                var mostRecentWrappedTask = (from t in crmContext.CreateQuery<ActivityPointer>()
                        (t.RegardingObjectId != null && t.RegardingObjectId.Id.Equals(incidentId))
                        && ((int) t.StateCode.Value == (int) TaskState.Completed)
                    orderby t.CreatedOn descending
                    select t);
                return mostRecentWrappedTask.ToList();


After writing this post, there is a simpler solution.  I retrieved all the Activities and had to loop through the list, discarding activities until I got to a Task or PhoneCall.

I could have used the ActivityType filter to retrieve the ActivityPointer records with an ActivityType of PhoneCall and Task.




Hosk’s Top CRM Articles of the week – 10th November



You can’t avoid the forces of change on your code, you can prepare for it by decoupling and reducing dependancies – Hosk

”Dirty code slows you down as well. If the code is clean, the next features go in smoothly.” – Ron Jeffries

You never know what worse luck your bad luck has saved you from.

—  Cormac McCarthy

What I learnt this week

Multiple online instances or tenants

You can delete CRM online instances or switch an instance of CRM online

I didn’t realise you could have multiple instances of CRM online or you can delete or switch instances.

Article of the week

Microsoft Dynamics CRM Developer Interview Questions

I have chosen my own article, outrageous!  It’s a whopper

Read Committed Snapshot Isolation (RCSI)–Know before you use it for your Dynamics CRM Database

An overview of Read Committed Snapshot isolation, a popular way to speed up your CRM DB.

Great old Post of the week

CRM 2011 Early Binding vs Late Binding Performance


Best of the Rest

A new developer Tool Bench, which does

  • Build URLs to open MSCRM forms.
  • Build URLs to open MSCRM views.
  • Finds the Guids hidden in MSCRM URLs.
  • Encoding and decoding of text.

API functions to control Subgrid behavior starting Dynamics CRM 2015 Update 1

New subgrid JavaScript functions in latest update

Scott Durow Visualisation

Who knew CRM data could look so good without putting on some silly space holo glasses

CRM 2011/2013 – What security roles do you to need to run a dialog

Do you know you need certain security roles to run a dialog!

Microsoft Dynamics Timeline

The history of Microsoft Dynamics CRM in a few minutes

CRM 2015 – Understanding impersonation in plugins and knowing when to use it

CRM Online 7.1.1 – Service Update

what’s been fixed in CRM online 7.1.1 – Service Update 1 for Microsoft Dynamics CRM Online 7.1.1

CRM 2013 – When using FetchXML is better than OData

There are some things FetchXML can do, which OData can’t

Boost sales with social selling

Social selling is shuffling into CRM 2016

MS CRM Custom WCF with Dual Encryption

Dual Encryption!

A good blog for Microsoft Dynamics CRM and Unified Service Desk

JSON Data Type Web Resource in Microsoft Dynamics CRM

It’s possible but why would you

CRM 2011 – how to update read only fields with Javascript

To update read only fields you need to change the setsubmit mode.  Read

CRM 2011/2013 – What does setSubmitMode do? and how does it work?

CRM 2015 – Quick way to navigate to your User record

How to quickly get to your user record

Yammer’s current state and why a CRM’er should take note of it 

Microsoft should update Yammer or replace it.  It’s still there so take note.

How to prepare Microsoft Dynamics CRM Data for Azure Machine Learning using SSIS and CData’s Dynamics CRM SSIS Components

Machine learning is coming, get ready

Microsoft Dynamics CRM Trust Center

CRM online trust credential, a great resource to answer potential customer questions

CRM 2015 – Why filtered views are useful

Filtered views are awesome, find out why

Bubble Charts in Dynamics CRM

A bubble chart in CRM, I never thought I would see the day


clean coder – future proof

Original Future Proof discussion

4 Easy Ways to Infuriate a Developer


A dozen things learned from Charlie Munger

The Statute of Limitations on Faulty Code

Simple way to do business writing

The remarkable Neal Stephenson interview

Interesting Videos

Atul Gawande talks

Previous top picks

Hosk’s Top CRM Articles of the week – 13th October

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things

Microsoft Dynamics CRM Developer Interview Questions

I found questions I used interviewing a CRM developer, The questions will give CRM developers an idea of the questions you might get asked in a CRM developer interview.

This article will help you prepare for a CRM developer interview.  The article will investigate the purpose of interview and discuss common topics with sample CRM developer questions

Interviews can be interesting experiences,  a time to reflect on your experiences and knowledge, but don’t be too good Should you hire a Rockstar developer for your CRM project?

Interviews are scary

Many people find interviews are scary because they contain the unknown.  When your mind thinks about unknowns it exaggerates things, focusing on worst case scenarios

  • Forgetting a technical detail
  • Not understanding the questions asked
  • You can’t remember any of your technical skills
  • The interviewer asking for skills and experience you don’t have
  • Turning up without trousers on
 I refer to this as the Stephen King television series concept.  The story IT is a great example
Stephen King television series start great, the monster is hidden in the shadows, mystery and unknown let people imagine something terrible as people disappear.
Interview are similar, you imagine how bad it could go.  It’s like the Stephen King series IT, the early stages and the clown is scary, when the final scary monster appears it isn’t scary (a big spider)

What is the purpose of the CRM Developer interview

Whilst preparing for the interview, consider the interviewer’s perspective and goals of the interview

  • What are the objectives of the interview?
  • Identify skills and experience for the role?
  • The interviewers context (e.g. developer, management, director)?
  • Will the interviewee work well with existing staff members?

People can exaggerate their CV’s, part of the interview process is validate what skills and experience the interviewee has.  You can assist in the process by giving as many examples of your experience and skills as possible.

Describe significant projects and your role in those projects, interviews are short so present the highlights of your recent experience.

The interviewer will see how truthful you have been on your CV and estimate your CRM knowledge and experience.

Key areas

CRM knowledge

  • Knowledge of CRM SDK
  • Understanding of CRM out of the box functionality
  • CRM certifications held


  • Projects
  • Your Roles on those projects (looking for role exaggeration is common)
  • Experience of CRM customizations
  • Size of project
  • Integrating external applications with CRM
  • Project style (Agile, Waterfall, others)


  • Where are you now?
  • Where are you going?
  • Why are you moving?

CRM certifications

I am a big fan of CRM developers getting certified (read why you should get certified and the benefits).  Studying for a CRM certification gives developers a good knowledge of out of the box functionality and its limitations.

Here are links to resources to help you pass the Customization and Config CRM certification


Certifications show knowledge of Microsoft Dynamics CRM, it gives no sign the person can create effective CRM solutions.  Certifications don’t show character, or how they will work with other team members.

Learn new CRM features and functionality

Learning new CRM features, understanding new functionality, keeping up with latest version of CRM shows a person is self-motivated learner.

If you haven’t worked with the latest version, having knowledge on new features is the next best thing.  Staying up to date with new versions of CRM and new functionality is being prepared for using it.

Experience and knowledge of CRM

Experience is an important commodity, you can’t buy it or learn it, only gain it.

I have seen .NET developers new CRM, struggle with CRM development due to the lack of CRM experience.

Why .NET developers struggle with CRM development

Whilst getting experience, CRM developers make and learn from mistakes and mistakes cost time and effort.  Those with experience are less likely to make the same mistakes.  Experience increases the chances of a successful CRM project.

Give examples of your experience in as many answers as possible, experience is one of your most valuable assets.


There will be questions on your career ambitions where do you see your career now? where do you see your career going?

Think about your career, you should have a destination in mind and a route to getting there.

The CRM world is small.  If unsuccessful in this job, you might work with the interviewee in this company or a different company.

Don’t criticise

NEVER be negative or critical about your colleagues. This wastes interview time on negative things, instead talk about your skills and experience.

No one likes to work with someone who criticises and blames their colleagues.  If you criticise your current colleagues, it’s likely you will criticise people in your new company.

Build your brand

Building your brand is preparing for an interview before you get an interview, it is not a quick process but a continuous process.

Build your brand by

  • Write a CRM blog
  • Create Youtube videos on Microsoft Dynamics CRM
  • Answer forum questions
  • Tweet about CRM
  • Create CRM tools
  • Slideshows/presentations
  • Attend CRMUG or other live CRM events
  • Interact with CRM community

Contribute to the CRM community, this could lead to you knowing and being recommended by employees of the company.  You can make a good impression before you make your first impression in the interview.

Creating content gives examples of your CRM ability, knowledge and experience, which can be found by the interviewers.

The Hosk CRM blog interviewers can see my CRM knowledge and experience and get an idea of who the Hosk is (yes the Hosk does like talking in the 3rd person!)

  • Your brand is you
  • Your point of view
  • Your experience
  • Your voice

Embrace your individuality, don’t copy other content but create your own unique content.  Creating a brand isn’t just selling yourself to people, you want to create a compelling interesting brand like the Apple iPhone compared to many android phones you can’t distinguish between.

CV and Project experience

You be asked to walk through your CV and explain it in detail, particularly the projects

  • Projects you worked on
  • Different customizations you created with problems/benefits
  • Different roles worked on projects
  • Project problems and how you overcame them

Practise Relentlessly

Interviewing is a skill, the more you practise a skill the better you get.  For an interview you are giving a presentation on yourself.

In the book Talk Like TED: The 9 Public Speaking Secrets of the World’s Top Minds, it has a great quote on practising your presentation

Practice relentlessly and internalize your content so that you can deliver the presentation as comfortably as having a conversation with a close friend.

Carmine Gallo

There is no excuse for not being prepared for a presentation where the topic is yourself.

Practice talking about your CRM experience so you can explain the projects, roles and the positive skills and experiences you got from them.

Practising helps you give a great interview because instead of thinking what to say, you are familiar with the content and are focusing on delivery.

Information to help prepare

Read Hosk Developer articles

These articles offer insights into understanding the CRM, CRM SDK and CRM developer processes and best practices.

Your approach to CRM development, diagnosing problems and best practices are key parts of a CRM developer.  Knowledge and skills can be learnt, but character and processes take longer.

Final Hosk tip

Skills and experience are important, but character is the vital.

Be confident and enjoy the experience if you don’t get this job it will have been an opportunity for you to practise your interview technique.

Make sure you have some questions to ask the interviewer. Moving job is a big decision, make sure the company is a great one, it’s likely you will be there for years.

8 Insightful Questions Only The Smartest Candidates Ask In A Job Interview

Enjoy the interview, you have nothing to lose and a job to gain.

Other CRM interview questions

This site has some great interview questions and answers

A collection of CRM interview questions for CRM 2011

CRM 2011 – Common CRM interview questions but what do they tell you?

Hosk‘s CRM Interview questions

I’m not going to give the answers to the questions because they would be my answers.  The questions are ones you might get asked, so if you are going to an interview think about the answers to show case your experience and thoughts on CRM development.

Q.  What is your CRM experience?

Question Purpose – A summary of CRM experience, your CRM career journey.

Mention – Role and experience, concentrate on the most relevant experience for the role

Q.  Tell me about your last CRM project?

  • Size
  • Complexity
  • Customizations
  • Integration

Question Purpose – The question aims to find out the experience of the

Mention- Mention different customizations, difficulties experienced and how you overcame them.  Show what skills you used and will bring to the role.

Q.  What development tools do you use for CRM development?

Question Purpose – CRM developers can answer this question if they have done CRM development.

Mention – CRM Developer toolkit, XrmToolkit, Ribbon Workbench, Plugin Registration.  Tools used in CRM development which you use.

Q.  When do you use managed and unmanaged solutions?

Question Purpose – Does the developer the differences between managed and unmanaged solutions, which can be a pain.

Mention – Discuss your experiences with Solutions, how you used them.  How would you use solutions.

CRM 2013 – Understanding Solutions and how they work

Q.  What are the disadvantages of managed and unmanaged solutions?

Question Purpose – Explain when to use managed solutions and when to use unmanaged solutions.  Solutions are key part of releasing the customizations to the customer, if done badly can cause problems and waste time.

CRM 2013 – Managed solution problems with out of sync solutions

Q.  How do you set up your CRM solutions?

Question Purpose – You can package the CRM solutions in lots of different ways, releases/sprints/phases, splitting up the customizations by type (e.g. plugins, javascript) or creating solutions with different functionality in.

Mention – Your experiences or ideas of how you think solutions should be created.  There is no right or wrong way

Q.  What are the potential problems with multiple developers working on a project?

Question Purpose – What development environments have you worked in, with how many developers, problems and solutions.

Mention – How you have developed solutions with a team of developers and what problems can arise.

Q.  How do you debug a plugin?

Question Purpose – Lots of CRM Developers debug in different ways but it’s an important skill because CRM developers must test be able to test and debug their code.

Mention – How you debug, e.g. Unit Test, console app, Remote Debugging or plugin registration tool

Q.  How do you debug Javascript?

Question Purpose – Debugging Javascript is a necessary skill for a CRM developer

Mention – Pressing the F12 key and getting your breakpoints setup and hit.  If you haven’t done this, try it out, it’s awesome.

Video CRM 2013 – JavaScript tutorial using CRM 2013 Developer Toolkit

Dynamics CRM 2011 JavaScript debugging in Internet Explorer 11

Q.  Have you integrated CRM with other systems, what was it and did you have any problems?

Purpose – Integrating CRM with 3rd party application or other Microsoft products is common.  It’s great if CRM developers have experience of this..

Mention – Any experience you have, problems you experienced and how you overcame them.

Q.  How to you estimate CRM customizations?

Question Purpose – Developers have to estimate work.  The greater accuracy you can estimate the better.

Mention – explain how you estimate customizations.  e.g. breaking up the work into smaller chunks, taking into account risks and experience.

Q.  Tell me about a project which went wrong, what were the reasons for the problems, how did you cope?

Question Purpose –  Projects can go wrong, problems will happen.  Showing the character to overcome problems and obstacles is an important skill.  Identifying the cause of problems, taking steps to avoid them will be useful to your prospective employer.

Mention – The lessons learnt and how you avoid potential problems.

Q.  How do you test your code?

Question Purpose – Unit testing code is great.  if you have experience mention it.  This question is asking how you test the logic of your code, which might not be unit testing.  You might debug your code or write a console app to run your code.

Mention – Unit testing knowledge and experience if you have it.  Your process of testing code.

Q.  Explain how pre-validate, pre and post are different plugins?

Question Purpose –  Specify how running a plugin in a different stage changes the purpose of the plugin e.g. pre before data is written to the database, post is after the changes have been written to the database.

Mention – Plugin stages, images and when you use each .

Q.  How are Asynchronous and synchronous plugins different?

Question Purpose –  Does the CRM developers understand the difference? Explain when to use an Async plugin instead of synchronus plugin.

Mention – Time.  Synchronus plugins must run straight away, async plugins can be delayed.

Q.  What is a common cause of plugin bugs?

Question Purpose – To find out if the developer has experience developing, if they have they will have experienced common errors.

Mention – The most common error is an infinite loop caused by updating fields, which triggers the plugin to run again and again

Q.  What is early binding, what are the benefits and the drawbacks?

Question Purpose – To understand if you the CRM developer understands the benefits of early binding.

Mention – Early binding creates strongly typed code which is easier to read and moves the errors to compile time and not runtime.  Early binding stops syntax errors which can occur with late bound code.

Q.  Should you keep up with the latest release of Microsoft Dynamics CRM?

Question Purpose – Does the CRM developer understand the benefits and disadvantages of keeping your version of CRM to the latest release.

Mention – Whenever you upgrade your CRM your customizations might stop working but you get the new features and fixes.  If you delay you have more versions to catch up to.

Should you keep up with Microsoft Dynamics CRM release cycle?

Q.  How do you keep up with Microsoft Dynamics CRM news?

Question Purpose – Does the CRM developer keep up to date with CRM, if so, how?

Mention – Blogs, certifications, Microsoft Dynamics community page

Q.  What is the effect of making a plugin sandboxed?

Question Purpose – CRM online can only deploy sandboxed plugins, so it’s important for a CRM developer to realise the limitations the sandbox can have.

Mention – CRM online can only deploy Sandboxed plugins and  Limitations such as

  • Access to the file system (C Drive)
  • systemevent log
  • certain network protocols
  • registry
  • You cannot access any other DLL’s
  • IP addresses cannot be used
  •  Only the HTTP and HTTPS protocols are allowed.
  • In isolated mode you cannot call any external DLL’s\DLL’s in the GAC

This blog had some good restrictions in a bit more detail

  • Attempting to use the AppDomain.CurrentDomain.AssemblyResolve event
  • IO.Path.GetTempPath() [System.Security.Permissions.EnvironmentPermissionException]
  • Any filesystem access code [System.Security.Permissions.FileIOPermissionException]
  • Attempting to use the EventLog [System.Diagnostics.EventLogPermissionException]
  • Attempting to use IsolatedStorage [System.Security.Permissions.IsolatedStoragePermissionException]
  • Any references to Thread.CurrentThread caused a security failure.

Read this blog Understanding Plugin sandbox mode for more information

Q.  When do you use OData?

Question Purpose – To test if the user has written many JavaScript customizations

Mention – OData is the primary method to retrieve information from related records

Q.  What Access teams and why would you use them?

Question Purpose – Access teams are not widely used, does the developer know what Access team are and how they work.

Mention – The purpose of access teams are to easily share records with a team of people where the members of the team are not static.

CRM 2015 – The benefits of Access Teams

Q.  What is Metadata and how is it used in CRM?

Question Purpose – Does the CRM developer know what Metadata is and how it works with CRM

Mention – Metadata is the data about data.  CRM has lots of Metadata, types of field, optionset value, auditing etc.  To retrieve Metadata you need use webservices, RetrieveEntityRequest for entity Metadata and RetrieveAttributeRequest

CRM 2015 – Understanding CRM Metadata

Q.   What things should you consider when choosing between CRM online or on Premise?

Question Purpose – CRM online has several limitations compared to CRM on premise, a CRM developer should understand them.

Mention – The big difference is you can’t see or modify the CRM server and SQL server.  CRM Online limitations, such as Sandbox plugins, workflow limit of 200, custom entities 300, storage is a monthly fee.

Q.  Why is code readability important?

Question Purpose – To find out if the developer designs code, codes to best practices

Mention – Reading and understanding code is important because code spends most of its time in a maintenance state.  Developers will need to read and understand code to extend the code, debug the code.

Why Code Readability is important

Q. If a user complained a particular CRM form is loading slowly, how to investigate, what to look for?

CRM 2011/2013 Investigating CRM Form Performance issues

Q.  If CRM stopped working, what would you check?

Question Purpose – This test experience.  CRM will stop working on production systems is good to know a CRM developer will know what to check.  To understand what to check the CRM Developer will need to understand the architecture of Microsoftt Dynamics CRM.

Mention – CRM Async services stopped, APP Pool service account password, SQL Server services, Disk space, Active Directory

Microsoft Dynamics CRM not working? check these common causes

Q.  What is the POA table and how can it affect performance?

Question Purpose – The POA table is used for security and sharing.  A large POA can cause performance problems

Mention – security, sharing problems.

PrincipalObjectAccess–Performance Recommendations

How would you questions?

Q.  validate a phone number on a form

Q.  Add a sequential counter to a custom entity

Q.  Automatically fill in an address field when a user selected a contact lookup field on a custom entity.

Q.  Send an email on the creation of an account record.

Q.  Update a status with a plugin

CRM 2013 – When using FetchXML is better than OData

“Ordinary people think merely how they will spend their time, a man of intellect tries to use it.” – Schopenhauer

I had a tricky problem where I need to select a lot of fields from an entity which was riddled with duplicates.

The oData query was bringing 1525 rows but after getting rid of the duplicates I was left with 25 rows!

OData  has no distinct

So why was the OData query bringing back so many rows because there is no distinct.  So the code was retrieving lots of data, it was then removing the duplicates.  It was a lose/lose scenerio

  • longer retrieve with more data
  • more time spent on getting rid of the extra data we didn’t need

I needed to clarify is there is no way to retrieve a distinct set using OData.  I looked on the internet and SDK but there is no distinct function with OData


A Developer mentioned FetchXML has a distinct field, I could change the query from OData to FetchXML and be able to filter the records returned.

I checked with Advanced find and you can’t set the distinct field attribute.

FetchXML has a number of aggregrate functions which are listed on this page – Use FetchXML aggregation

The following aggregate functions are supported:

  • sum
  • avg
  • min
  • max
  • count(*)
  • count(attribute name)
FetchXML also has some Groupby functionality, which can be very useful

How to Generate the FetchXML

So I did an Advanced find, copied the xml and found in Tanguy Toolbox XRMToolBox there is a fetchXML Tester.


I recommend the FetchXML Builder, which you can download and then will work with the XRMToolBox

FetchXMLBuilder can be downloaded here

The FetchXML Tester will run any fetchXML you have generated from an Advanced find, once you have the core FetchXML you can then edit and change it but it’s quicker to use Advanced Find to get something to start with.

The FetchXMLBuilder is better for creating new FetchXML queries because it has a great UI to allow you to build up a query.

It’s a bit like the Dynamics CRM OData Query Designer but for FetchXML.  I used it recently to query when a certain Plugin assemblies had been uploaded

fetchxml 1


This is an example of the FetchXML tester with the Distinct set to true

<fetch distinct='true' mapping='logical' aggregate='false'> 
   <entity name='account'> 
      <attribute name='attribute name' alias='alias name'/> 

Here is the example I created

Tools can help

I was lecturing/Advising a junior developer who had a similar requirement.  He was about to manually create a big soap command to run the fetchXML.

Instead of doing it yourself, see if there is a framework or tool to help you.  Find a framework first, which will do all the nasty donkey work for you of creating the soap messages.

Microsoft Dynamics CRM has lots of tools, solution and frameworks created by the CRM community, it’s often worth looking for a tool/framework to see if someone has resolved the problem.

I have reviewed lot of tools here

Hosk’s CRM 2013 Tools List

For this problem I needed a framework instead of a tool, I narrowed it down to two

XrmServiceToolkit – A Microsoft Dynamics CRM 2015/2013/2011 JavaScript Library

CrmFetchKit.js – Script Library for Dynamics CRM (SOAP)

Both could have done the job but I chose XRMServiceToolkit because it had more followers on CodePlex and seemed easier to use.  I had experience using it before, it’s always easier to do something when you have got it working before.

The XRMServiceToolkit looked a more complete solution.


So instead of doing an OData call, retrieve thousands of rows and then removing the duplicates, I changed to use a FetchXML from JavaScript using the XrmServiceToolkit which returned just the rows I needed and was much quicker.

There are lots of alternatives in Microsoft Dynamics CRM and the skill of a good CRM Developer is choosing the right customization for the job.  Choosing the right customizations is often understanding the limitations of each type of customization.


CRM 2015 – Quick way to navigate to your User record


The happiness of most people is not ruined by great catastrophes or fatal errors, but by the repetition of slowly destructive little things.

I often need to navigate to my user record, usually to check my security roles, doing this using the standard navigation can take lots of clicks.

If you have to something often then it’s worth investigating the quickest way to do it.

CRM insanity is doing the same thing over and over again, when there is a quicker way –Hosk

An example of a common task is retrieving the GUID of a record, CRM 2013 – quick way to get the guid on a form but there is a quicker way using a bookmark with Javascript, which automates the Javascript I used in my blog post.

This blog has an example of Javascript book to get the guid –  Get Guid of an Entity Record in CRM 2013/2015

Below are quick ways to get to your CRM User record

Option 1 – Personal settings

There are a few ways
Click on the Cog –> Personal Options
Scroll down and you can click on my user information
Find your user settings

Option 2 – Bookmark

CRM 2013/2015 shows dynamic Urls instead of direct urls.



The last number is a dynamic number which you can’t bookmark.

If you navigate to the your user record by going through Settings –> Administration –> User Record.  The url won’t change but once you are on this page you can click the three dots

… Email Link

This will open Outlook with a url, linking directly to your User Record, e.g


Paste the url into your Internet browser, you can bookmark this and it will take you directly to your user record.

You can navigate to your User record with one click instead of 5 or 6.

Bookmarks rock

Links to individual records are useful if you often need to go to the same record, it’s worth bookmarking them.  You can have project records such as Custom Configuration record or a popular account/contact record.

When using CRM 2013/2015 I create a folder which contains useful bookmarks, such as

  • User
  • Main Dev Solution
  • Solutions
  • Security
  • God Mode (awesome, it makes all fields editable)
  • Get Guid

These two blogs will show you how to setup the Bookmarklets

Bookmarklets Updated

CRM Navigation Hacking with Bookmarks

Hosk’s Top CRM Articles of the week – 2nd November


A great list of articles and blog posts this week, enjoy.


Some men learn all they know from books; others from life. both kinds are narrow. The first are all theory; the second are all practice.

It’s the fellow who knows enough about practice to test his theories for blow-holes that gives the world a shove a head, and finds a fair margin of profit in shoving it.

George Lorimer, Letters from a Self-Made Merchant to His Son

The kernel of a strategy contains three elements: a diagnosis, a guiding policy, and coherent action. The guiding policy specifies the approach to dealing with the obstacles called out in the diagnosis. It is like a signpost, marking the direction forward but not defining the details of the trip. Coherent actions are feasible coordinated policies, resource commitments, and actions designed to carry out the guiding policy.

Good Strategy/Bad Strategy: The difference and why it matters by Richard Rumelt.

To get an overview of the book read A primer on strategy from the excellent Farnam Street blog

Article of the week

CRM Chart guy says Funnel Charts Suck and You Shouldn’t Use Them.

If you have tried to wrestle, persuade, force, shout at, plead, or trick the charts in Microsoft Dynamics to show something useful, you will realise it’s a difficult job.

For this reason you have to admire the awesome blog posts from CRM chart guy

Best of the Rest

CRM 2015 – The benefits of Access Teams

Understand the benefits of Access teams and start using them

A free customizable Editable Grid for Dynamics CRM 2013/2015!

A free editable grid

CRM 2015/2013 – All you need to know about Database Encryption

Database encryption can cause problems if you restore a backup of a CRM database because the encryption won’t work.  This article will help you understand what is encrypted and how to add the encryption key

Your Interaction Network in Dynamics CRM

Great post from CRM MVP Jukka explaining Activity Party and how data interacting with you is held and can be displayed in CRM

Meet the 7 major improvements of the new MS Dynamics CRM 2016

The highlights of CRM 2016, it’s coming soon

Microsoft Cloud Certification could allow complex CRM solutions to go online 

There’s a different choice between on-line or on-premise

Using Full-Text Search to improve Dynamics CRM search experience

Shows how you can search full text in CRM

Querying with no table lock

FetchXML has no table lock, who knew

CRM MVP Daniel Cai shows you how to get data into CRM faster

Great Slidedeck showing you how to import data in CRM

How to find the number of users connected to a SQL Server database

An SQL query to tell you how many users are connected to your CRM database

CRM 2011/2013 – Understanding and adding the deployment administrator role

Do you understand the Deployment Admin roleChanging a Custom Entity Icon in Dynamics CRM

whitepaper – Deploying Microsoft Dynamics CRM in Microsoft Azure Virtual Machines

Four Acquisitions To Make Dynamics CRM Awesome

Leon Tribe informs Microsoft of the next businesses they should buy, Listen up Microsoft

Microsoft Dynamics CRM not working? check these common causes 

If Microsoft Dynamics CRM on premise has stopped working, check out these common causes

Bulk Delete

Answers to common bulk delete questions

Microsoft Dynamics CRM and Sandbox to Production Revisited

Comparing the sandboxes of CRM and Saleforce

Upgrading CRM: How to Move from a Data-driven CRM to a Process-driven CRM

Do you need to change your thinking and processes when moving to from CRM 2011 to CRM 2013/2015

CRM Performance: Nothing is Gained by Running

Why rushed projects/code doesn’t save time and reduces quality

Running faster doesn’t always get you there quicker.

Eight ways to ensure the failure of a CRM project management (Part 1)

13 signs your CRM project is doomed

If you’re having CRM problems I feel bad for you son

I got 99 problems but my CRM Project ain’t one.


Moore’s Law Turns 50

Coding by the Book: The 7 Books Every Software Developer Should Read

SQL Server 2016: Everything built-in

Please, don’t commit commented out code

Why coding skills are not enough for a developer to get hired


What Book has the Most Page-for-Page Wisdom?

First, interact

The Multitasking Virus and the End of Learning? Part 2

A Primer on Strategy

Previous top picks

Hosk’s Top CRM Articles of the week – 13th October

Useful Hosk Links

Hosk list Of CRM 2013 Tools

A list and review of CRM 2013 tools, this will probably work in CRM 2015 as well

Hosk’s CRM Developer Articles

A collection of my favourite CRM Developer articles I have written

MB2-703 – CRM 2013 Customization and Configuration Certification Information

All the CRM 2013 content to help you pass the exam

HoskWisdom – Hosk Developer Quotes

 Words of Wisdom from the Hosk.  I have written over 900 articles, surely I should have said a few memorable things