Monday, December 29, 2008

Action Cancelled: MSCRMKeyGenerator - 18949

When openning the CRM shortcut you promptly receive the message "Action Cancelled"

Error log details:
Source:   MSCRMKeyGenerator
Event ID: 18949

Current active key (KeyType : CrmWRPCTokenKey) is expired. This can indicate that a key is not being regenerated properly. Current Active Key : CrmKey(Id:c2e0c738-dc7a-dd11-b61e-00188b3466e9, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True.....
I recently came across this error a few times. On all occasions I had no luck in sorting it out the usual way:

Start services.msc and ensure that Microsoft CRM Asynchronous Processing Service is started.

If like in my case, you find that this service was already running, then save yourself hours of scratching and simply restart the SQL Server housing the CRM database. 

I'm yet to find the specific reason behind this error.

Thursday, December 25, 2008

Holiday travel through India

I've just returned from holidays over the past couple of months. Its been a holiday long awaited and well enjoyed.

I've just returned from India as a first time tourist. I managed to travel the Ragestan region and south through to goa on a death trap on two wheels... Royal Enfield 500. I can't believe those bikes were built in the first place.. India is still mass producing these 1950's mostrocities as the best model of two wheel transport in the country.

the country is a living photograph.

I'm happy to report NO food poisoning AND was not shot a single time by terrorists.

Merry Christmas everyone.

ps: I've just discovered that all 8 CRM 4.0 Accellerators have been released in my absence. This is great news. I'm looking forward to playing with them over the next few days.

Merry Christmas and a Happy New Year

Well here it is again... It feels only a month ago I recovered from last new year's frivolities.

Wishing you all the best this Christmas and new year!!!

Tuesday, November 11, 2008

More Microsoft Dynamisc CRM Accelerators Released

Another CRM Accelerator was released yesterday. 

They are available on CodePlex along with full source code as promised:

Download them now…
Incedentally, if you're not familiar with these tools, here's a video introduction to CRM Accelerators presented on Microsoft's Channel 9 by Ruben Krippner.

Thursday, October 30, 2008

Announcing Release of Microsoft Dynamics CRM Accelerators

Ahh… Finally we have a release of 2 of the new CRM Accelerators. 

As I mentioned a couple of weeks ago, the Microsoft CRM team had announced in a live meeting that 5 of the 8 CRM Accelerators were to be released very shortly. Just as I was about to fall off the edge of my seat, I found the release of the following 2 CRM Accelerators as of 30-Oct-2008: 

  • CRM Notifications Accelerator
  • Extended Sales Forecasting Accelerator

I guess 2 are better than none.

As a Microsoft Partner you can access these from the Partner Source website: 

All installation files, documentation and source codes are freely available and fully supported.

Sunday, October 26, 2008

Liberation Day! Steve Ballmer - Sydney - 6 November 2008

A rare event is at hand! Steve Ballmer is coming to Australia.

This is truly one of the rarest opportunities to hear fist hand, the most influential person in the IT industry. 

Together with Gianpaolo Carraro', Senior Director, Microsoft Corporation, and Tim Sneath, Director, Microsoft Corporation, we will be hearing about Microsoft's vision of the future of software development and cloud computing.

This event will be held at Sydney Convention Centre, Darling Harbour. Tickets are available by invitation only. If you don't have one yet, then there may still be a handful available from your favourite user group. On the other hand, if you miss out on Sydney tickets, don't panic. The event will be available on Live Rally. Don't miss out!

Tuesday, October 21, 2008

CRM Accelerators Due for Release This Week

5  of the 8 Microsoft Dynamics CRM 4.0 Accelerators are due to be released within the next few days:

The remaining 3 will be available by the end of November:

All accelerators will have multi language compatability and are fully supported my Microsoft. Read more about them at the Microsoft Dynamics CRM Team Blog.

I'm sofar very impressed with the Beta and previews. The idea is to fully empower CRM developers to modify and customize these tools to fully suit their needs, so the package on offer will be quite extensive...

  • Compiled Installer + full source code
  • Installation, setup and usage documentation
  • Technical documentation
  • Walkthrough and tutorial videos

Upon release, there will be a discussion forum set up for developers to discuss and get help on customizing these tools.

Incidentally, some of these tools are due to be included as the standard package in CRM 5.

More posts on these tools to come shortly.

Wednesday, October 15, 2008

The Data Migration Manager encountered an error while setting up the temporary migration database

Microsoft Dynamics CRM 4.0 Data Migration Manager can be used to import data from other systems into CRM 4.0 and is a vastly improved version over 3.0. This tool can be used to map data into all standard and custom entities and is very simple to use.

However, I ran into a couple of small issues on my first encounter with this tool.

Having made my installation on a different machine to the SQL Server, I immediately encountered security issues. The selected user needs to have full administrative rights to the SQL Server installation. After making the necessary changes to my administrative rights, installation and setup proceeded smoothly, bet then upon sign in I encountered the following error:
The Data Migration Manager encountered an error while setting up the temporary migration database. Restart the data migration manager and try migrating the data again.

With Albert Einstein's looming in the back of my mind I did the same thing over and over again, expecting a different result... Needless to say, it drove me mad.

Interestingly I found that the temporary migration database was actually created on the remote SQL Server.

The accompanying Readme file suggests the folowing:
One possible source of this error message may be the UserReplicationID registry key. You can resolve this issue by deleting the registry key, restarting Data Migration Manager, and signing in again.

You can find this registry key in the following path (depending on your system type):

* 32-bit systems: HKLM\SOFTWARE\Microsoft\Data Migration Wizard
* 64-bit systems: HKLM\Software\Wow6432Node\Microsoft\Data Migration Wizard
Unfortunately this did not work for me. My solution was to uninstall and re-install the package, using SQL Server Express on the same machine as the DMM installation. Due to performance issues, we were finally forced to move the entire installation to the local machine hosting the full SQL Server deployment.

It seems this issue was related to the use of DMM with remote access to the temporary migration database. Although my user is a local admin of all machines involved and has full access to SQL Server, I still believe the issue is caused by a lack of security rights to something along the chain.

I've since found that the package will install, but configuration will fail for 64bit SQL Server 2005, even on the local machine. This is entirely unsupported by that application.

See the Dynamics Team Blog for more tips on using and getting the best performance out of DMM and the Dynamics Data Migration Trouble Shooting page.

Sunday, October 5, 2008

Error installing CRM 4.0 and reporting services on SQL Server 2005 Workgroup Edition

While making a new insallation of CRM 4.0 recently, I encountered a little error:

Setup requires SQL Server Reporting Services 2005 Hotfix for role creation on SQL Reporting Service SP2 Workgroup edition at the specified Reporting Services Report Server http://CRMServer/reportserver.

I found it fairly difficult to locate this elusive hotfix. So for anyone else looking for it.. Request your hotfix from

Now, before everybody gets up in arms about the idea of "Requesting a hotfix", you should be aware that although Microsoft Dynamics CRM hotfixes are not so freely available to download, they are simple to aquire. Just make your request from the Microsoft Dynamics CRM Hotfix site, and within seconds the download link and password(if applicable) will be emailed to you.

Sunday, September 21, 2008

Cybner / NSquaredSolutions Merger

Cybner has been undergoing a number of changes recently.

I'm happy to anounce that Nsquared Solution and Cybner have agreed to a merger. This is great news, in particular for our existing clients. In particular we now have access to many more resources in order to provide an even higher quality of service.

Sunday, September 7, 2008

Microsoft Dynamics CRM Javascript Access to Form Elements

Here's how to access each control on your forms using Javascript. Using this information you can add very useful functionality to CRM's front end.

There are a couple of ways to do this, you can choose which ever suits your situation best...

Currently displayed entitie's GUID:

To access a control on the form:
    // OR

Hide/show attribute(set to visible or invisible):
    //Hide it
    crmForm.all.[attributename].style.display = "none";
    //Show it
    crmForm.all.[attributename].style.display = "inline";

Enable/disable attribute:
   crmForm.all.[attributename].Disabled = true;
   crmForm.all.[attributename].Disabled = false;

Does control/attribute contain any data?
   if (crmForm.all.[attributename] != null)
       //Contains some data

Control's value(this is the current on screen value. ie, may not have been saved yet):
   // OR
   // OR if its a checkbox
   crmForm.all.[attributename].Checked = [true false=""]
   // OR if its a lookup
     //Descriptive name for the selected item
     //GUID value of the selected item
     //Type of entity selected in the lookup(1=Account, 2=Contact...)
     //Descriptive name for the selected entity type

Reference External Javascript file in CRM form events

Some times you may have a great deal of Javascript code to insert into your CRM entity's form events, be it OnLoad, OnSave or OnChange of a control.

It is possible to encapsulate the functionality or procedures into separate JS files and reference them from the form. I often do this and have a list of standard JS files with specific functions as I need them. You can insert the file into your event by ading this block of code.

//Insert JS Functions to perform whatever functionality:

var script = document.createElement("script");

script.language = "javascript";

script.src = "http://crmserver:5555/ISV/JSFiles/CRMControlFunctions.js";


Don't forget to substitute your own server, port and filename. Ensure that it's hosted in a website or virtual directory and reachable from the CRMWeb website application.

Saturday, September 6, 2008

Access MS CRM data through the Web Service via Javascript SDK

So I was madly typing away and badly mixing my languages up as I tried to remember how to access the CRM Web Service using Javascript from the front end when I finally succumbed to calling on a Google search.

I don't usually post something that I've already been able to find on the net, but it took me a while to find this and when I did... Oh man it was like a gift from heaven.

A fantastic post by Jason Hunt at Ascentium:
A Microsoft Dynamics CRM JavaScript SDK

Tuesday, August 26, 2008

Plugins and Add-ons With Multiple Server CRM Deployment

Recently I had a remarkable amount of trouble with the SDK on a particular CRM deployment. After a spot of poking around I managed to find that this deployment actually consists of 3 servers.
Application Server
Platform Server
Database Server

This configuration seemed to be working fine for some time with plugins hosted on the Application Server, but when I came to write applications using the web services hosted on the Platform Server I received the following error: 0x80044191 Assembly can not be loaded from C:\Program Files\Microsoft Dynamics CRM\server\bin\assembly\MyOrganisation.Plugins.dll. Platform.

Here's the fix:
If plugins are registered, ensure they are deployed with source on database.

If the plugin source MUST be on disk, then it must be stored on the Platform Server. Not the Application Server

Sunday, August 10, 2008

Winforms: Close your form during Load event:

On occasion you may find that you need to open a form and have that form then decide if it needs to remain open.

Closing a form through click of a button is normally not an issue. Its as simple as:

Me.Visible = False

The second method will clear and remove the form from memory. But this means that the form would already have to be visible. Doing this during Form Load will cause an ObjectDisposedException.

But you want your form to close BEFORE it even becomes visible to the user? There are 2 ways to do this.

If your form is a dialog:
VB: Me.DialogResult = DialogResult.Cancel
C#: this.DialogResult = DialogResult.Cancel;

Otherwise, place this code in the form load event:
VB: Me.BeginInvoke(New MethodInvoker(AddressOf Me.Close))
C#: this.BeginInvoke(new MethodInvoker(this.Close));

Thursday, July 17, 2008

Display Database Image in SSRS from Northwind demo database.

If you’re reading this, then like me you probably fiddled around for an hour or so, scratched a hole in your head and wondered how such an easy job can be so impossible.

We’re building a SQL Server Reporting Services report that displays an image retrieved from a database field. This is easy.. Assuming that you already know how to build a simple SSRS report, to add a database image, simply select the image field into your dataset, drop an image control onto your report and select its “value” to the value of the image field from your dataset.

If you try this using the SQL Server version of Northwind, you’re sure to have trouble. The image will not display and you’ll get a little red cross in the control.

After a quick google search I came across these sites:

Robert Porter speaks the fact that the images saved in the Northwind database are not standard GIF formats, but OEM. Basically caused by converting a MS Access database to SQL Server. There’s also some sample there, but that didn’t work for me. Eventually after a lot more research and help, we have this line of code that converts the OEM GIF image into one readable by SSRS:

System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Photo.Value), 105))

If you must use Northwind’s original data to display an image on an SSRS report, then use the above line as the image value. Any other SQL Server image field would not need this and will work just fine by simply using the plain field value.

Monday, July 14, 2008

Set the State/Status of A Custom Entity in CRM 4.0 in VB

In addition to Catherine Eibner's post below on setting the satus of a custom entity in C#, I'd like to help the more logical programmers out there by posting the VB version..

Catherine Eibner: Set the State/Status of A Custom Entity in CRM 4.0

'This will set a task as complete
Dim SetTaskState As New SetStateTaskRequest
SetTaskState.EntityId = MyTaskGUID.Value
SetTaskState.TaskState = TaskState.Completed
SetTaskState.TaskStatus = -1

'This will deactivate a custom entity
'Note the SetStateNew_customentityRequest while the name of the
'entity is new_customentity.
Dim SetCustEntityState As New SetStateNew_customentityRequest
SetCustEntityState.EntityId = MyCustomEntityGUID.Value
'Note New_customentityState when entity name is new_customentity
SetCustEntityState.New_customentityState = New_customentityState.Inactive
SetCustEntityState.New_customentityStatus = -1

Friday, July 11, 2008

Server was unable to process you request | CRM SDK Error Handling...

Using the CRM 4.0 SDK to write a callout and you get the error massage "Server was unable to process you request".

CRM Throws SOAP Exceptions from the Web Service. That's why you need to use the following to get to the actual error...


Catch ex As System.Web.Services.Protocols.SoapException
MsgBox(ex.Message & " : " & ex.Detail.InnerText)
Catch ex As Exception
...More exception handling logic...
End Try


//Exception handling
//Exception handling

for MSDN's official documentation on CRM 3.0

Thursday, July 10, 2008

Customize CRM Logo image and colors...

I've spent a fair bit of time looking for ways to change the CRM header logo and page color... My final conclusion is that it is entirely unsupported by MS. Never the less, it is possible to customize your pages to suit your client/company look and feel.

Note carefully though, that these changes are completely unsupported and may be overwritten by service packs and/or hotfixes in the future.

CRM is essentially just a website with masses of .Net pages and SQL Server as its engine, its very easy to hack its content. Now, I would suggest strongly that you at least take a backup copy of every file you are about to modify or better yet, take a backup of the entire folder BEFORE you start.

Changing the CRM Logo to your company logo...

There generally seems to be multiple copies of files slightly different from one to the other.

The easiest way is to go to your CRM installation's website files, typically C:\Program Files\Microsoft CRM\CRMWeb. This is where all the .Net files and images are stored.

The main logo image is C:\Program Files\Microsoft CRM\CRMWeb\_imgs\masthead.jpg along with masthead_live.jpg, masthead_live_rtl.jpg and masthead_rtl.jpg for various situations. You will also need to modify the file mast_back.gif. This image allows for resizing of the window.

Simply replace these images with your own copies to the same dimensions. and you now have your own branded CRM. That was the easy part.

Alternatively, you could modify the page(eg C:\Program Files\Microsoft CRM\CRMWeb\_common\styles\global-dynamic-styles.css.aspx) that calls these images, but logically, I think it would be safer an easier to just replace the images.

Changing all pages to suit your company's look and feel...

Now you want to change CRM's standard blue, outlook feel to suit your business.

This part of the job is massively time consuming. There are proximately 46 million aspx, css, xml, xsl... files and images within the CRMWeb folder. You need to visit each one individually and change any reference to a color to your own equivalant one. There doesn't seem to be a very good standard of colors used in CRM and you'll notice that there are 46 million slight variations of a similar shade of blue in each file. It almost as if they've done this on purpose to discourage developers from touching it!?!?!?

I suggest that you gather maybe 6 different shades of your own colors and systematically replace each CRM shade of blue. Every change is live upon saving, so you can check the resulting page instantly. Once all web pages have been visited, its time to modify each of the 46 million images(within the _img folder).

You should expect to spend 2-4 days depending on how finely you need it tuned.

NOTE: Occasionally the client browser may not update to recent changes and may need IE temporary files to be cleared.
Hi.. I'm glad to introduce myself as another cursed blogger in this blog saturated world. After years of relegation I've decided to join you all.

Mostly for the reason that I find much of my resources as a result of other kind people's blogs. As karma would have it, I best pay back the community they way it has aided me. I hope my blogs turn out to be of some use to somebody out there as yours have to me...

If anyone reading my posts has any comments, questions, suggestions or corrections, it would be my pleasure to hear from you.

Thankyou All, Bloggers..

Kiavash Shakibaee