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.
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.
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('statuscode', Microsoft.Xrm.Sdk.Query.ConditionOperator.Equal, 10)
result = service.RetrieveMultiple(query)
for r in result.Entities:
r['statecode'] = Microsoft.Xrm.Sdk.OptionSetValue(3)
r['statuscode'] = Microsoft.Xrm.Sdk.OptionSetValue(32)
The friendly folks over at Packt Publishing recently sent me a copy of Microsoft Dynamics CRM 2011 Scripting Cookbook by Nicolae Tarla. I have worked for them in the past as a technical reviewer (unpaid) and they asked me to review this book for them.
I really enjoyed Nicolae’s work, it’s a great book and I have no reservations about recommending this to others. It really is a fantastic piece of work.
I was recently asked to provide a small training sessions for a user who preferred to use the keyboard for navigation. After digging up all the shortcuts from the CRM user guide (and a couple which are not listed) I decided to make these A4 posters to highlight the most interesting and less obvious ones.
I often have a situation where I have a record ID and need to open the record form, and the opposite where I have the record form open and I need the ID. Usually I can do both of these by messing around with the URL of a form, however that can be quite longwinded.
To that end I have created Simplicity, a small tool which performs two basic actions:
1. Stripping the IDs out of MSCRM record URLs – useful when have a record open and you want to know its decoded ID.
2. Building a URL to open a record – useful when you have the ID and you want to open the form in CRM.
License under Creative Commons Attribution 3.0 and available for download here.
Determination is a light weight IronPython scripting tool specifically setup for MSCRM 2011.
Determination is licensed under Creative Commons Attribution 3.0.
You can download Determination here. To run; download, unblock the zip, unzip the zip and run the application.
A couple of day’s ago I was asked to export all the unmanaged solutions from an environment for the purposes of backup. There was more than a few so to avoid having to do them all manually I hacked out this code; which when given a service and directory will export all the unmanaged from the environment.