CRM 2013 Adding an On Change Event to a Grid View

Occasionally I’ve been asked how to add an on change event to a grid view, similar to an on load or save event, which will allow a developer to add some code to the page. As far as I know there is no supported way to do this, however I had a bit of brain wave this week and realised its possible with a ribbon (command) button.


Continue reading

CRM 2013 Programmatically Comparing Security Roles

This code will print out all the differences between two given security roles. Useful when you need to sanity check your work or debug security issues.

Differences between Marketing Manager and Marketing Professional
Marketing Manager has prvActivateBusinessProcessFlow: Global
Marketing Manager has prvActivateSynchronousWorkflow: Global
Marketing Manager has prvAppendCompetitor: Global

Marketing Professional has prvActivateSynchronousWorkflow: User
Marketing Professional has prvAppendEmailTemplate: Bu

Continue reading

CRM 2013 Programmatically Comparing User Privileges

When debugging security issues it can be useful to compare the privileges of a functioning user with a non-functioning user.

The code in this post will print out all the privilege differences between two given users.

Differences between and has BU:root, PRIV:prvCreateAccount, DEPTH:Global has BU:root, PRIV:prvCreateActivity, DEPTH:Global has BU:root, PRIV:prvCreateArticle, DEPTH:Global has BU:sub, PRIV:prvCreateActivity, DEPTH:Deep has BU:sub, PRIV:prvCreateArticle, DEPTH:Global

Continue reading

CRM 2013 Check if all mandatory fields are populated with JavaScript

Today I needed to check if all fields on a given form were populated, as I didn’t know exactly which fields would be mandatory at any one time I need something that dynamically searched the form for all mandatory fields and checked to see if they had a value.

Fortunately this is actually pretty straight forward.

Checks if all the mandatory fields are populated.

@method MandatoryPopulated
@return {bool} True if all fields are populated
MandatoryPopulated: function() {
	populated = true;

	Xrm.Page.getAttribute(function (attribute, index) {
		if (attribute.getRequiredLevel() == "required") {
			if(attribute.getValue() === null) {
				populated = false;
	return populated;

CRM 2013 Diagnosing “Access Is Denied” using Fiddler

I recently had to diagnose a CRM 2013 “Access Is Denied” message, back in the world of CRM 2011 this was pretty straight forward. CRM would present an option to download a log file and the log invariably pointed me in the right direction.

However I’ve found that CRM 2013 no longer presents the same option to download the log, you just get the generic error message with no further detailed information. As I was using CRM Online I was unable to check the server logs myself and I didn’t have time to contact Microsoft support.


Continue reading

CRM 2011 Rollup 15 and JavaScript Asynchronous Load Order

Those us who use multiple independent JavaScript web resources found that rollup 12 changed the way these were loaded. In particular that they loaded asynchronously and (most importantly) in no particular order. This meant that if you had file A which was dependent on some function in file B. If file A loaded before file B loaded, then file A would throw ‘”something” is undefined’ errors. The behaviour (and fixes) is expanded on in these posts: CRM 2011 Polaris Asynchronous Javascript Loading and Asynchronous loading of JavaScript Web Resources after U12/POLARIS.

At the time I struggled to find an official release from Microsoft commenting on this change – it seemed like a breaking change that caused issues in a number of deployments so I was surprised this wasn’t sign posted more explicitly (maybe I missed something in the release notes :|).

In any case it appears this may now be changing – at least in respect to load order. In the release notes of Rollup 15 under ‘Issues that are resolved in Update Rollup 15 for Microsoft Dynamics CRM 2011’ there is this little nugget:

Loading order of web resource script files is not respected after Update Rollup 12.

It’s difficult to tell exactly what this means and what change will occur, however it definitely suggests that the load order will now be respected (even if they do load asynchronously), which seems like a good thing.