12 April 2010

Run Exe From A CRM Button

Right, here's a nice easy one to ease me into this blogging lark.

I was recently asked how you'd go about firing an EXE from a CRM button, now this isn't the best thing to be doing but here's how to do it.

Note: The exe path must be visible from the client machine.

Assuming that you want the button to appear on the entity form add the following to the isv.config:


<Button Icon="/_imgs/ico_18_debug.gif" JavaScript="fireExe();">


Now you need to add the following to the OnLoad event of the entity that displays the button:


fireExe = function()
{
var oShell = new ActiveXObject("WScript.Shell");
//Note: all back-slashes (\) must be doubled up (Single \ is a control character in JavaScript)
var prog = "c:\\WINDOWS\\System32\\notepad.exe";
oShell.run ('"'+prog+'"',1);
}
The above example will fire NotePad whenever the user clicks the button.

Note: Internet Explorer security settings will probably need to be changed for the Internet Zone that CRM is running under to allow ActiveX code to execute.

07 April 2010

About Me, About This Blog

Where to start, well I'm a Dynamics CRM Lead Consultant in the UK. I've worked, as a developer and consultant, with Dynamics CRM since the beta version of V1.0 and implemented one of 5 V1.0 installations in the UK. Thinking back to V1.0 brings me out in a cold sweat now!

The purpose of this blog is to bring my "CRM Green Bible" (those that have worked with me know about this book of tricks) out from the dark ages, well paper based, and digitalise it. There are a couple of reasons for this, one it's a pain to carry around and I never have it when I want it, secondly I hope that other people will find some of the things that I've noted useful.

Over the coming weeks I'll be updating this blog with my existing notes, and I'll be throwing in a few new things that I find.

This blog will provide information for the easy items, hiding tabs, and other things that are more complicated, filtered lookups for example. This is as much to jog my memory as it is to make me look clever (I hope).

Now for the boring disclaimer bit:
  • Some of my posts will provide information based on information that I've found on other blogs, if I can remember where I got the information from I'll acknowledge the fact.

  • Where possible I always try to find supported methods, but that's not always possible. I'll inform you when it's not a supportable solution.

  • Anything that is on this blog has no relation to my employer, and if you implement something it's down to you, if it breaks your system you fix it (I'll do my best to help but I'm not taking responsibility).
Wow that was a long post.....