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.

Advertisements

IronPython CRM 2011 Script for Checking Entity Audit Settings

Recently I needed to compare three different environments to see which entities were being audited. In the interests of making a boring task into an interesting task I decided to do this with an IronPython script.

I did this using Determination my IronPython/CRM 2011 tool, when given a connection string this will run through every entity in the environment letting you know which entity is being audited and which is not.

Continue reading

Microsoft Dynamics CRM 2011 Reporting

I recently acted as a technical reviewer for a new book; Microsoft Dynamics CRM 2011 Reporting by Damian Sinay. This book is now available from Packt Publishing so I thought I would publish a short review. (Note: I’m not paid by Packt for this role but I do get a free book).

Continue reading

Microsoft Dynamics CRM 2011 Cookbook

Untitled

I recently acted as a technical reviewer for a new book; Microsoft Dynamics CRM 2011 Cookbook by Dipankar Bhattacharya. This book is now available from Packt Publishing so I thought I would publish a short review. (Note: I’m not paid by Packt for this role but I do get a free book).

Continue reading

IronPython CRM 2011 Script for Copying Forms

So I’ve got an entity which has two very similar and very long forms. I made changes to one form which I needed to replicate on the other. I didn’t want to do that manually because that seemed like a very tedious and longwinded piece of work. So instead I used some code.

I did this using an IronPython script and Determination my IronPython/CRM 2011 tool.

Continue reading

IronPython Script for Deleting Waiting CRM 2011 Workflows with an Error Code

So last week I had to clear out 1000’s of waiting workflows which had error codes in a CRM 2011 environment. I did this using an IronPython script and Determination my IronPython/CRM 2011 tool.

Its a pretty straight forward task, first deactivate the workflow (oddly, using an update call and not SetStateDynamic) and then delete the record. For those interested in performing such a task here is the full source.

import clr

clr.AddReference('Microsoft.Xrm.Sdk')
clr.AddReference('Microsoft.Xrm.Client')

import Microsoft.Xrm.Sdk
import Microsoft.Xrm.Client.Services

connection = Microsoft.Xrm.Client.CrmConnection.Parse(r'[connection string goes here]')
service = Microsoft.Xrm.Client.Services.OrganizationService(connection)

query = Microsoft.Xrm.Sdk.Query.QueryExpression('asyncoperation')
query.Criteria = Microsoft.Xrm.Sdk.Query.FilterExpression()
query.Criteria.AddCondition('errorcode', Microsoft.Xrm.Sdk.Query.ConditionOperator.NotNull)
query.Criteria.AddCondition('statuscode', Microsoft.Xrm.Sdk.Query.ConditionOperator.Equal, 10)

result = service.RetrieveMultiple(query)

for r in result.Entities:
	print r.Id
	r['statecode'] = Microsoft.Xrm.Sdk.OptionSetValue(3)
	r['statuscode'] = Microsoft.Xrm.Sdk.OptionSetValue(32)
	service.Update(r)
	service.Delete('asyncoperation', r.Id)