C#, CRM

CRM Plugins – Input Parameters and Early Binding

I recently came across this problem looking at a CRM instance that had been upgraded to use early-binding. They had done something like below:

var accountInputParameters = ((Entity)context.InputParameters["Target"]).ToEntity<Account>();

This takes the InputParameters (which is of type Entity) and then bound it to the Account early-bound type.

While this seems like a good idea on the surface, as it allows all the fields of the Account to be accessed using strongly typed properties, the customer reported some strange behaviour on their Accounts.

Continue reading

CRM, JavaScript

Some helpful CRM 2016 Bookmarklets

I’ve been working in CRM Online (2016) a little for the past few weeks and I found these little bookmarklets to be helpful.

For those that don’t know, a bookmarklet is a snippet of JavaScript that can be saved as a Bookmark in Chrome, IE or Firefox. By prefixing your JavaScript function with javascript: you’re telling the browser to execute JavaScript rather than go to a particular URL

So far I have bookmarklets to

  • Print the current entity’s schema name
  • Print the current entity’s ID
  • Reopen the current entity’s form

The Print ones are quite nice because I used CRM’s in-built notification system.

Continue reading