Thursday, December 18, 2008

How to make a workflow wait until a certain date

How to make a workflow wait until a certain date might seem trivial but it isn't all that clear when using the GUI, but I found a nice blog with good pictures explaining how to do it so instead of reinventing the wheel, I'll just give you the link: http://www.askcrm.com/Default.aspx?tabid=866&EntryID=55

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Sunday, November 23, 2008

AT&T Wireless self destructs...

It's actually an old story by now but I just recently heard of it from my new staff manager and it is a very interesting story of just how bad a CRM implementation can get. It concerns Siebel and my analysis of the story is that the reson for the crash was mostly due to bad management and a lock on both timeframe and functionallity, something I believe is impossible if you want to achieve any kind of quality. This case being the perfect example.

Please read it and leave a comment here if you want to discuss it!
http://www.cio.com/article/32228/Project_Management_AT_T_Wireless_Self_Destructs

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Wednesday, November 19, 2008

Automatic restart of Async Service

When developing new workflow activities for CRM 4.0 you need to release the filelocks on the dll to be able to copy the new dll to the assembly directory. This can of course be done manually by restarting the service in the service manager but can be scripted into the prebuild events aswell, so that it is more automatic. Add the following two lines to the Pre-build events of your workflow activity project to make it restart the MSCRMAsyncService:

net stop "MSCRMAsyncService"
net start "MSCRMAsyncService"

Please note that you might inflict any ongoing workflows by doing this so take care if it is a live production server.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Friday, November 14, 2008

Quick create

As many of you know, in CRM 3 there is a special view of an entity form called quickcreate. This is used when you press "New" in a lookup window. For instance, on an account you can press: select primary contact, when the search dialog shows you can instead of selecting an existing contact press the new button and a "slimline" version of the contact form show with just the must-have and should-have fields available.

In CRM 4 this feature is not used any more and the complete form will always be shown in this case, however, the functionality hasn't been removed. I tried to find some kind of reference to it in the SDK but couldn't so I had a look in the original CRM code in CRM 3 and found how to do it.

To open a form as quick create, find the object type code (1 = account etc) and go to the URL:
http://[server:port]/[organisation]/_forms/QuickCreateReturn/quickcreate.aspx?crmFormSubmitObjectType=[objecttypecode].

For example, for account on the local machine when CRM is installed on port 5555 and the company is named "company":
http://localhost:5555/company/_forms/QuickCreateReturn/quickcreate.aspx?crmFormSubmitObjectType=1

Since I couldn't find any official reference to this in the SDK it is very possibly unsupported to do this but it works for now. Any hotfixes or similar might, but are not very likely to change this functionality, new versions of CRM like v.next are more likely to change/remove this functionality.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Tuesday, November 11, 2008

Putting all javascript code in external files

Dynamics CRM is great. It has some really nice functions like being able to add javascripts to different event in the form to handle special needs of the GUI.

However, it is only fine as long as these scripts arn't that many and not too complex. When they start getting more and more complex, bigger and their numbers start increasing it soon becomes an impossible tast of maintaining them all and there is no built in function to handle javascript includes without special code. It also takes a long time developing more complex code in the javascript form window in CRM and then running the preview or publishing it each time before testing.

There is light in the tunnel however, by using the technique specified bellow, you can both
get global javascript files, save and refresh only to see you changes, and keeping all scripts for one entity in one file (and not one for onLoad, one for onSave and one for each onChange that is needed).

A lot of credit for this has to go to Michael Höhne at Stunnware since he added a posting on his blog on how to manage javascript includes in runtime.

So, first of all we have to put some standard code in the onLoad. This should only be done once and it shouldn't really be changed until you need to publish it for release (switching of the caching).

var LoadFile = function(url, cache)
{
var httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
httpRequest.open("GET", url, false);
if (!cache)

{
httpRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
}

httpRequest.send(null);
return httpRequest.responseText;
}

eval(LoadFile("/isv/mycrmext/javascripts/MyGlobal.js", false));
eval(LoadFile("/isv/mycrmext/javascripts/Account_onload.js", false));

This code simply loads and executes the two files MyGlobal.js and Account_onload.js located in the directory C:\Program Files\Microsoft Dynamics CRM\CRMWeb\ISV\myCRMEXT\JavaScripts
and can be found at the url: :port/isv/mycrmext/javascripts/">http://:port/isv/mycrmext/javascripts/.

So, copy-paste it into the onload event form in the account form editor in CRM. Activate the event, save and publish.

Then you can create the two .js-files at the specified directory. Start with just some test code like:
alert("This is the MyGlobal.js-file");
or something similar.

The next step is to try to avoid using the onsave and onchange events. This is quite easy when you know how but it is sort of in the gray area of supported customizations so be aware of this.

In the file Account_onload.js add the following code:
var MyOnSave = function()
{
alert("onSave");
}

var MyOnChange = function()
{
alert("onChange");
}


alert("onload)

crmForm.attachEvent("onsave", MyOnSave);
crmForm.all.name("onchange", MyOnChange);

This attaches a simple function to the onsave event of the form and another to the onchange event of the attribute "name".

The functional defintions/declarations can be put into any of the includefiles.

Now, just save the file, and open an account to see the magic! (It should show a dialog when loading with the text "onload", when the accountname is changed, it should show "onchange" and when saved, it should show "onsave".

Please note that I would advise you to put the javascript files in the same "host" from a IE perspective since you will get less problems with cross domain scripting and similar IE related security issues. This doesn't however mean that you cannot put the js-files anywhere on the internet where the clients can access it.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Wednesday, November 05, 2008

How to get the URL to the reportserver programmatically

I was searching the net the other day to try to find a way to programmatically get the reporting server url from CRM. I thought that there must be some way to find it using the standard CRM webservice and I really looked throught the SDK and all the blogs I could find to see if anyone knew.



Finally I gave up and tried to find some other way to get it and I remembered that it is set in the registry so I wrote some code to get it from there and here it is in all it's simple glory:



RegistryKey regkey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MSCRM");
string reportserver = regkey.GetValue("SQLRSServerURL").ToString();




And it worked but only just since it uses the server name and my VPN connection to the customers environment didn't bother with sending it to me why I have to manually add it to the hosts file.



The host file can be found at the path: C:\WINDOWS\system32\drivers\etc\hosts



and I added the row:

192.168.0.100 CRMTESTSRV



Now my button which point to my aspx that redirects to a the report in pdf-format works just fine and is independant of the CRM server it is installed on.



The solution isn't supported as far as I know since you never know if they might change the registry value in the future (not very likely in an update but might happen in an upgrade). If anyone has any supported way of getting this URL, please comment this post.



This could also be done using javascripts but I find it easier to manage server side code and it doesn't add that much overhead considering the report has to be generated independantly of if I use aspx or javascript to open the report.



Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Sunday, October 26, 2008

Attribute problems

As I have described earlier, a controlled and consistent handling of the customization file is very important in order to maintain coherent and properly mirrored systems.

As I am reading the book "CRM as a rapid devleopment platform" by David Yack at the moment, I will probably be commenting a bit on some of it's content. Even though I might not fully agree to all that is said in the book, I must really give it my best recommendations since it is really a good tool and has a lot of very useful tips and code libraries that can be used.

One of the things Yack treats in the book is the how to import and export customizations and his recommendation is to take as few entities as possible. My personal view is still that the best way to maintain "mirrored" systems and avoid any problems when importing, is to almost always move the entire set of customizations (using the import/export all entities) since I believe that will reduce the risk of anything bad happening and that the systems might accedentally not be the same until someone notices that an entity hasn't been moved from one system to another. Yack's manner of handling this is not directly wrong in my opinion, and it might work well but there might be need for more extensive documentation of exactly what customizations exist in all the different systems (for those who didn't read that posting, most commonly: Production, Test, Central Dev, Educational and Distributed VPC Devs)

A similar problem that might give rise to some headaches is that you might have seen to it that all systems have the same customizations and then notice that some attribute might have the wrong data type, and since you can't just change the datatype, you remove it and then recreate it using the same name as before. Now you try to export and import this entity to some other system, it will crash due to the fact that CRM will try to append the changes made but it doesn't log that you have removed the attribute and will just export an image of the exisitng system. When importing, it will try to find any changes and add these. When it find's a missmatch in the datatype of the entity in question, it will simply stop the importing.

So, try not to change attributes or entities this way. If you have created an attribute with the wrong datatype, remove it and create the new one with another name.

It is probably also possible to first remove the attribute, export the customization and import it to ALL system and then add the attribute, export and import it to all systems. Then you might get it to work but it's easy to miss one development VPC system and then you'll have to remove the attribute(s) by hand and that just isn't very good since these kinds of changes should be limitied to the customization master system.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

The application platform on which CRM has been built

Some dicussion has been ongoing on wheter the application platform on which Dynamics CRM has been built will be used for other purposes, most noticable has probably been David Yacks book that I have discussed previously, that focuses more on this platform than on Dynamics CRM.

Today, since it is Sunday and I have some "free time" I took the opportunity to read The CRM Teams Statement of Direction and I found a very interesting part in the end that give a very direct statement on how Microsoft views this:

"Thus the underlying technology platform becomes an application engine to run a whole range of business applications. Microsoft Dynamics CRM simply becomes one business application that is run on the application platform."

So, perhaps we have put our card on the right horse this time (compared to Lehman and Brothers investors) since the future might show that experience in CRM development isn't only going to be a great asset when working with CRM but also a great asset since it will allow us to have a good heads start on the application platform, and the new applications that will be built ontop of it.

Discussions has also been around what is going to happen with NAV and AX. This is mere speculation, but it might just be that theses applications are the first to be migrated to the new application platform. So, get you MPC (Material and Production Control) books out and dig into ERP since that might just be the right skill to have.

If you havn't noticed, the work name for the new version of CRM is V.Next. Let's see if it will be 5.0 or perhaps 8.0? :)

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Sunday, October 19, 2008

CRM as a Rapid Development platform

David Yack, a Microsoft MVP has written a very good book for developers working with Microsoft Dynamics CRM 4.0 independantly of the actual solution, being CRM or some other solution.

He focuses a lot on viewing the Dynamics CRM platform as a development platform instead of just an application with a powerful API. This is a view I believe many Dynamics CRM developers share with him. The book also focuses a lot on working as a consultant and the choices that one needs to take when working as a consultant, like, is this sort of solution going to be working independantly of new hotfixes, patches and upgrades or are we going to create a cause for conflict with our customer.

As many of you know, Dynamics CRM addresses these issues as a platform in the definition of "supported" customizations and this is discussed throughout the book.

Included in the price of the book is also an entire library of useful tools that can be used when developing and that Yack recommends using in real life projects and that are licenced as such.

It is THE book for all Dynamics CRM developers looking for both tips and tricks on how to for instance, actually create a plug-in and also great use in understanding that Dynamics can be used as a platform for developing almost any kind of application. Yack has deliberatly left out information concerning how to use CRM out-of-the-box and other normal application based aspects of Dynamics CRM, something I find very good since it focuses the book on what it is meant to do.

If you work with development in Dynamics CRM, this is probably going to be one of the best investments you can do, since it will help you create better customizations faster with more customer value, and who doesn't want that?

Thanks David Yack for a great book!

Read more here: http://www.thecrmbook.com

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica Sweden
www.logica.com

Friday, September 26, 2008

Handle customization.xml (.zip) with care

As you probably know as a Dynamics CRM professional, all entity customizations, javascripts and more can easily be exported and imported between systems. This is a really neat feature of Dynamics CRM since it relieves us a lot of tiresome and repetitive work of recreating lots of settings for each environment set up.

It is not uncommon for a project to involve more than 3 or 4 depoyments that need to be identically set up. Usually the following are used:
- Production environment
- Test environment
- Central development environment
- Distributed developent environment(s) - usually locally run VPC:s
- Educational environment

If care isn't taken when creating customizations and exporting and importing the customization files it is not hard to imagine problems arising when the same entity has been edited by different people at more or less the same time. This can result in the several of the different systems not being identical and perhaps even dataloss or the worst possible case, a system might crash. Therefore it is very useful to define a strict path for all customizations and the distribution of all customizaton files.

We usually handle this by simply defining the central development environment as the customization-master. This means that all entity customizations are done on this environment only. Then customizations are exported by almost always exporting all customizations and importing into all other systems from this file. This will hopefully reduce the risks of creating environments that are non-identical or erroneous.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Monday, September 22, 2008

The power of SharePoint

Presently I am employed at Logica as a consultant and the projects I am involved in are always Dynamcis CRM centered. However, I used to work at Humandata earlier, run by the SharePoint MVP Göran Husman and I am since this time a devoted SharePoint fan.

At the time I was involved in several SharePoint implementations and we also had SharePoint as our Intranet at Humandata.

A couple of months ago Microsoft Office SharePoint Server was released at Logica as the global Intranet tool and I must say it is amazing to see the true power of SharePoint in a large organisation. At Humandata we were less than 20 employees and we all knew each other and more or less lived in the same City. The story at Logica, however, is drastically different, with around 40 000 employees in 41 countries.

With SharePoint we can now all communicate, I have taken the initiative to start a Logica-Global Dynamics CRM community to connect all the very talented Logica employees that in some way or another work with Dynamics CRM. We are still in start-up mode but the future looks bright and SharePoint is the enabler that makes it all possible.

Apart from this, it is also a great tool for running projects in. Instead of millions of post-its with all the questionsmarks in the project, we use a discussion board. Instead of impossible hierarchies of folder for SureStep documents, we use one Document Library with Meta-data describing what part of SureStep the document should be connected to. This way, documents are easier to find, easier to work with, easier to share and we get version control all for free.

So, if you are part of a large organisation, try to push for the use of SharePoint especially if this organisation is spread over a large geographical area and the use of virtual meetingspaces and focalpoints is of great use.

If you are employed at Logica and would like to be part of the community, just send me an email or leave a comment bellow - they are moderated so I don't have to publish them if they are private.

One thing to be remembered though, even if SharePoint is easy, nobody is born to understand it or the concepts in it, especially if you are used to working in a normal directory based filesystem, so make sure all your users get a good basic run-through and give them the possibility to dig deeper on their own. If you neglect the educating of the users you risk spoiling most of your investment, and the users view of SharePoint, something that is both sad and bad.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica Sweden
www.logica.com

Monday, September 15, 2008

Mark appointment as complete from Outlook?

When attempting to execute some of the more common tasks of everyday work as a salesperson, my colleague Joakim Westergren and I found that there actually isn't a way of marking an appointment as complete from the normal appointment window in Outlook (like for instance a Task). If any of you reading this, know of a way, please let me know.



We did find a workaround however. We told the salespeople that when an appointment was to completed, to just add the words "DONE" or some other special character like "§" after the normal text in the description field. A workflow had been created that is triggered on changes to the description field and it checks to see if the text inside the field ends with "DONE" or the designated character. If so, the status of the appointment is changed to "Completed".



I realise that this isn't a perfect solution, a button would be suitable and less prone to error, but at least it is one way of handling it. I would be very intrested in any other solutions that you might have experience of, please leave a comment if you have any suggestions.



(Of course you can always open the CRM window and click "Save as completed" but that introduces a new GUI and complicates things for the users, we are looking for a simpler approach, just using Outlook)



Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica Sweden
www.logica.com

How to create a phonecall directly from Outlook

I am currently working in the early development or late design phases of a project and a few days back, I and my colleague Joakim Westergren were going through the normal sales process and started wondering if there wasn't an easy way of creating a phonecall activity from Outlook, with the same GUI that you create for instance emails or appointments (by pressing the "Set regarding"-button). After a while, we found it but it wasn't obvious so I thought you'd might like to know.


You actually create a new Task and then press the lower part of the "Track in CRM" button and select "Phone Call". The Task is now saved in CRM as a phonecall. Of course you also have to set the "Set Regarding".



Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica Sweden
www.logica.com

Tuesday, September 02, 2008

Nominated to .NET-Awards

Hi y'all!
My parental leave is soon at it's end and this thursday I will be back to work in full force! Hopefully I will also have lots of interesting topics to write about aswell!

.NET Awards will be held this thursday here in Sweden in the Stockholm suburb of Kista. The solution I have been working with since I started at Logica, ICE42 for ICE.NET, a Swedish Telecom Operator, has been nominated and we will hopefully win!

If you are fluent in Swedish you can watch a move with my colleague Mats Jonasson and the CIO of ICE.NET Thomas Norberg as they talk about the solution. Unfortunatley, I was ill the day of the recording, hence, I am not in it.

.NET Awards 08 Nominerad: Logica Sverige AB
.NET Awards 08 Nominerad: Logica Sverige AB



Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica Sweden
www.logica.com

Tuesday, April 22, 2008

Upgrading callouts to CRM 4.0

Hi again,
Busy as ever, I am still working on this large CRM project with lots of integrations. Very complex and very interesting.

At the moment we running CRM 3.0 but we are currently looking at upgrading to CRM 4.0 since we need to implement a new datamodell containing more than 40 very tighly connected entities with multiple relationships, self referentail relationships and much more! We are very lucky to be working with CRM 4.0.

The first part of the upgrade we are doing will be to just get everyting working in CRM 4.0 with as little or no code review as possible. We will lift all the code later (i.e. converting callouts to plug-ins, using the new web service and so on) when we have got everything running.

In other words, I first of all needed to get callouts from CRM 3.0 to work properly in CRM 4.0. After the "sleep-inducing-upgrade", I found that they simply didn't work. As I had made a few callouts that generated custom accountnumbers and other similar tasks, it became clear that it crashed because of the callouts.

I activated CRM tracing (http://support.microsoft.com/kb/907490/en-us) and soon found that the reason for the callouts not working was that CRM could not find the dll containing callout.base. So, I added the dll (Microsoft.Crm.Platform.Callout.Base.dll, found on the CRM 3.0 CD 1) to the GAC (C:\windows\assembly) and then ran iisreset.

After this, the callouts worked just like they should!

On the same topic, if you have a custom virtual directory bellow the CRM website, just add the file: C:\Program Files\Microsoft CRM\CRMWeb\bin\Microsoft.Crm.WebServices.dll to the GAC aswell, since it won't work otherwise. There are other ways of getting around this problem aswell, but I prefer this solution.

On the first of may I will be on parental leave for 4 months, so that I can really get to know my daughter without my wife getting in the way! ;)

Hopefully I will have time to write a bit on this blog aswell.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica Sweden
www.logica.com

p.s.
If you havn't tried Bio Shock on XBOX 360, you really should!

Tuesday, March 04, 2008

isv.config in CRM 4.0

I recently wanted to add a button in CRM 4.0 and I found that, even though there are many similarirties with CRM 3 there are some differences. I thought I'd share this with you and also some examples of it with a minimal (empty but working) isv.config and a one-button-in-order-version so that it will be easier for you to add your own buttons.

First of all, in CRM 4.0 there is no isv.config in the _resources folder any more. Not very strange since CRM 4.0 is multi-tennant and each tennant can have a unique isv.config. So, where is it? The most obvious place to look for it is in the "export customization" view, and surprise, there it is!

So, to change it in short, select isv.config from the export customizations and press select "export selected customizations" from the action menu. Save the zip-file somewhere, unzip the xml and open it in your favortite xml editor or notepad. When done, just import the xml directly (yes, it supports importing the xml file directly without zipping it first). If you have done your job correctly, there should be no problem, if not, you might get an error. Revert to an older version of the file (always save a backup before doing any changes) and then try a smaller change.

To activate isv.config customizations you have to "enable" these customizations from the web.config in the CRM web folder. Please see the SDK for more info.

To make things easier for you, here is the code in an empty/minimal isv.config (that has worked for me any how). There might be things that can be removed still, to make it smaller. Please leave a comment if you know of any. Please note the lcid:s (language code id:s) that appear all through, as you can see, this is the english version (1033).


<ImportExportXml version="4.0.0.0" languagecode="1033" generatedBy="OnPremise">
<Entities>
</Entities>
<Roles>
</Roles>
<Workflows>
</Workflows>
<IsvConfig>
<configuration version="3.0.0000.0">
<Root>
<NavBarAreas>
</NavBarAreas>
<!-- The main Global Menu Bar located at the top of all root level areas -->
<MenuBar>
<!-- Custom Menus that appear between the Goto Menu and the Help Menu -->
<CustomMenus>
<Menu>
</Menu>
</CustomMenus>
</MenuBar>
<!--
Application Level Tool Bar
-->
</Root>
<!-- Microsoft Customer Relationship Management Entities (Objects) -->
<Entities>
<Entity name="account" />
<Entity name="contact" />
<Entity name="lead" />
<Entity name="opportunity" />
<Entity name="list" />
<Entity name="campaign" />
<Entity name="campaignactivity" />
<Entity name="campaignresponse" />
<Entity name="incident" />
<!-- Case -->
<Entity name="quote" />
<Entity name="salesorder" />
<!-- Order -->
<Entity name="invoice" />
<!-- Custom Entities -->
<!-- <Entity name="new_myentity"/> -->
<!-- End Custom Entities -->
</Entities>
<!-- Microsoft Customer Relationship Management Service Management Customization -->
<ServiceManagement>
<AppointmentBook>
<SmoothScrollLimit>2000</SmoothScrollLimit>
<TimeBlocks>
<!-- All CSS Class mapping for Service activities -->
<TimeBlock EntityType="4214" StatusCode="1" CssClass="ganttBlockServiceActivityStatus1" />
<TimeBlock EntityType="4214" StatusCode="2" CssClass="ganttBlockServiceActivityStatus2" />
<TimeBlock EntityType="4214" StatusCode="3" CssClass="ganttBlockServiceActivityStatus3" />
<TimeBlock EntityType="4214" StatusCode="4" CssClass="ganttBlockServiceActivityStatus4" />
<TimeBlock EntityType="4214" StatusCode="6" CssClass="ganttBlockServiceActivityStatus6" />
<TimeBlock EntityType="4214" StatusCode="7" CssClass="ganttBlockServiceActivityStatus7" />
<TimeBlock EntityType="4214" StatusCode="8" CssClass="ganttBlockServiceActivityStatus8" />
<TimeBlock EntityType="4214" StatusCode="9" CssClass="ganttBlockServiceActivityStatus9" />
<TimeBlock EntityType="4214" StatusCode="10" CssClass="ganttBlockServiceActivityStatus10" />
<!-- All CSS Class mapping for Appointments -->
<TimeBlock EntityType="4201" StatusCode="1" CssClass="ganttBlockAppointmentStatus1" />
<TimeBlock EntityType="4201" StatusCode="2" CssClass="ganttBlockAppointmentStatus2" />
<TimeBlock EntityType="4201" StatusCode="3" CssClass="ganttBlockAppointmentStatus3" />
<TimeBlock EntityType="4201" StatusCode="4" CssClass="ganttBlockAppointmentStatus4" />
<TimeBlock EntityType="4201" StatusCode="5" CssClass="ganttBlockAppointmentStatus5" />
<TimeBlock EntityType="4201" StatusCode="6" CssClass="ganttBlockAppointmentStatus6" />
</TimeBlocks>
</AppointmentBook>
</ServiceManagement>
</configuration>
</IsvConfig>
<EntityMaps />
<EntityRelationships />
<Languages>
<Language>1033</Language>
<Language>1036</Language>
<Language>1031</Language>
<Language>3082</Language>
<Language>1053</Language>
</Languages>
</ImportExportXml>

And the one containing only one button:

<ImportExportXml version="4.0.0.0" languagecode="1033" generatedBy="OnPremise">
<Entities>
</Entities>
<Roles>
</Roles>
<Workflows>
</Workflows>
<IsvConfig>
<configuration version="3.0.0000.0">
<Root>
<NavBarAreas>
</NavBarAreas>
<!-- The main Global Menu Bar located at the top of all root level areas -->
<MenuBar>
<!-- Custom Menus that appear between the Goto Menu and the Help Menu -->
<CustomMenus>
<Menu>
</Menu>
</CustomMenus>
</MenuBar>
<!--
Application Level Tool Bar
-->
</Root>
<!-- Microsoft Customer Relationship Management Entities (Objects) -->
<Entities>
<Entity name="account" />
<Entity name="contact" />
<Entity name="lead" />
<Entity name="opportunity" />
<Entity name="list" />
<Entity name="campaign" />
<Entity name="campaignactivity" />
<Entity name="campaignresponse" />
<Entity name="incident" />
<!-- Case -->
<Entity name="quote" />
<Entity name="salesorder">
<MenuBar>
<!-- Custom Menus that you may add -->
</MenuBar>
<!-- The Account Tool Bar -->
<ToolBar ValidForCreate="0" ValidForUpdate="1">
<Button Icon="/_imgs/ico_18_debug.gif" Url="http://www.microsoft.com" PassParams="1" WinParams="" WinMode="0">
<Titles>
<Title LCID="1033" Text="asdf" />
</Titles>
<ToolTips>
<ToolTip LCID="1033" Text="Info on Test" />
</ToolTips>
</Button>
</ToolBar>
<!-- The Account Left Nav Bar -->
</Entity>
<!-- Order -->
<Entity name="invoice" />
<!-- Custom Entities -->
<!-- <Entity name="new_myentity"/> -->
<!-- End Custom Entities -->
</Entities>
<!-- Microsoft Customer Relationship Management Service Management Customization -->
<ServiceManagement>
<AppointmentBook>
<SmoothScrollLimit>2000</SmoothScrollLimit>
<TimeBlocks>
<!-- All CSS Class mapping for Service activities -->
<TimeBlock EntityType="4214" StatusCode="1" CssClass="ganttBlockServiceActivityStatus1" />
<TimeBlock EntityType="4214" StatusCode="2" CssClass="ganttBlockServiceActivityStatus2" />
<TimeBlock EntityType="4214" StatusCode="3" CssClass="ganttBlockServiceActivityStatus3" />
<TimeBlock EntityType="4214" StatusCode="4" CssClass="ganttBlockServiceActivityStatus4" />
<TimeBlock EntityType="4214" StatusCode="6" CssClass="ganttBlockServiceActivityStatus6" />
<TimeBlock EntityType="4214" StatusCode="7" CssClass="ganttBlockServiceActivityStatus7" />
<TimeBlock EntityType="4214" StatusCode="8" CssClass="ganttBlockServiceActivityStatus8" />
<TimeBlock EntityType="4214" StatusCode="9" CssClass="ganttBlockServiceActivityStatus9" />
<TimeBlock EntityType="4214" StatusCode="10" CssClass="ganttBlockServiceActivityStatus10" />
<!-- All CSS Class mapping for Appointments -->
<TimeBlock EntityType="4201" StatusCode="1" CssClass="ganttBlockAppointmentStatus1" />
<TimeBlock EntityType="4201" StatusCode="2" CssClass="ganttBlockAppointmentStatus2" />
<TimeBlock EntityType="4201" StatusCode="3" CssClass="ganttBlockAppointmentStatus3" />
<TimeBlock EntityType="4201" StatusCode="4" CssClass="ganttBlockAppointmentStatus4" />
<TimeBlock EntityType="4201" StatusCode="5" CssClass="ganttBlockAppointmentStatus5" />
<TimeBlock EntityType="4201" StatusCode="6" CssClass="ganttBlockAppointmentStatus6" />
</TimeBlocks>
</AppointmentBook>
</ServiceManagement>
</configuration>
</IsvConfig>
<EntityMaps />
<EntityRelationships />
<Languages>
<Language>1033</Language>
<Language>1036</Language>
<Language>1031</Language>
<Language>3082</Language>
<Language>1053</Language>
</Languages>
</ImportExportXml>

Gustaf Westerlund,
Microsoft Dynamics CRM Architect,
Logica Sweden

Wednesday, February 13, 2008

SQL error when importing customization.xml

Today I was deploying from a development environment to a test environment and part of this is moving the customizations made within the CRM GUI. I simply exported the customizations.xml and tried to import it to the test system. Only to get a very angry "SQL Error". Hmm... not very nice to see those, that usually means that somethings gone really bad, and you usually wish you hade just taken a complete backup of CRM.

Well, things only got worse when I tried to access CRM with the common url, I got a really nasty error saying that some custom attribute wasn't at all like some other custom attribute. No dah, my worst fears just got real and I could only face the fact that the CRM meta database had somehow become corrupt. Really bad, testing was supposed to begin today, so really bad timing (and timeplan).

So, what to do? Since I couldn't access CRM I couldn't get to the import cusomtizations page, so I had a look in the SDK for the direct URL to the import customizations page (it is under sitemap customizations). I tried to reimport the customizations file from my development server, only to find that CRM now found the xml "malformed" in this file. After some testing, I found that it acctually found all customizations files to be malformed, not only the first one. So, something really sinister is at hand. Time to log into the SQL-Server.

The first message that faced me was that one of the drives had to litte disk space... I had a look and found that the main data disk had only 2 MB free. So, this was probably it. First, there probably hadn't been space enough for commiting all the changes that were in the new customization file and then there hadn't been space enough to upload the new customizations file. The error message of mal-formed xml had just been an erroneous error message.

So, I freed some space on the disk and just to be sure, I re-installed CRM entirely (it was just a test environment after all) and imported the customization file, and all went well!

Well, there was acctually one thing, when I imported the customization file I got an error saying that at some row XXX in the file there was something wrong. At the specific row, was a tag for setting "displayInApplication" or something like that for the entity "Bulk Operation". I tried to remove the tag and import it, which worked. I later remembered that I hadn't installed Update Rollup 2, which I later confirmed was the cause of this error. I had exported from a CRM 3 UR2 system and imported into a standard CRM 3, hence the error. So, I would suggest not removing the tag but instead updateing your CRM :).

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

Installation of Virtual Server 2005 R2

We have invested in a virtual server host, a really cool machine with Dual Quadcore XEON processors and 16 GB memory (yes, I am some what of a techno-geek). To be able to use it properly, I wanted to install Virtual Server 2005 R2.

Not so easy. I connected with remote desktop and tried to install virtual server, but I just couldn't get it to work properly, so I went out on the net and looked for a solution.

The result was that I found that you cannot install or run the virtual server web interface using remote desktop if you do not connect as "console". Weird, but that's what I found.

So, how to connect with remote desktop as "console" (that is ID 0). If you like your command prompt, you'll know that Remote Desktop is called "mstsc" just, use that with the switch "/console" and you will connect as console.

Personally I like to make things simple, why I have made a small bat-file with the following content:
mstsc %1 /console

Then I just drag-n-drop my rdp-file ontop of the batfile. This will result in a console connection to the server set in the rdp-file.

I hope this helps!

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

Friday, February 08, 2008

Jonas Deibes pictures and Q&A from the CRM 4.0 launch

I forgot to give you the link to Jonas Deibe's posting concerning the CRM 4.0 launch in Stockholm where he a nice picture from the blog corner and some interesting Q&A.

http://blogs.msdn.com/jonasd/archive/2008/02/07/blog-corner-report-from-the-swedish-crm-4-0-release.aspx

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

CRM 4.0 launch and more...

Yesterday Microsoft Dynamics CRM 4.0 finally launched and there was a big Microsoft happening i Nacka Strand close to Stockholm. The location was great, only about 100 m from my office :).

At the launch there was a blog corner where both Jonas Deibe and Michael Höhne were answering questions and drinking som coke. I took the opportunity to have a look at Michael's (http://www.stunnware.com/crm2/) filtered Lookup a bit closer. I had read some about it on his page and it is really a great piece of software. In short it enables filtering of lookups and in CRM even the intellisense. It is not yet fully supported by Microsoft, but Michael mentioned that it soon will be.

I also got the opportunity to talk to Jonas Deibe a bit and we talked mainly on what the differences in developing extensions are between CRM 3 and 4.0. I will go deeper into some of this in later postings.

I also got meet some of my Microsoft Dynamics CRM friends from Cybernetics, Cinteros, SysTeam and of course, Microsoft Sweden. I hope we'll meet again soon.

As I have described earlier, we at WM-Data (Will formally be named Logica from feb 27:th) are so busy at the moment that we have to de prioritize some customers, which I find very sad, since I don't like to disappoint anyone in general and customers, in particular. So, if you are a good Microsoft CRM developer and interested in working with really big customers with very interesting projects, concerning complex integration and other interesting customizations in an international organization that is really employee-friendly, please contact me and we can have a chat! My office is in Stockholm, but Logica has offices all over Europe and even in India (Bangalore).

Thats that for this time, hope to be back soon!
Stay in touch!

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

Friday, January 25, 2008

Adding SQL Reporting Services reports to CRM

As you are probably aware, Microsoft CRM 3 and 4 uses SQL Reporting Services for creating reports. If you are familiar with this tool from non-MS CRM implementations, there are a few tricks for getting the reports to work correctly. Please read the CRM SDK and the report writers guide for specific details on parameter naming and some other stuff.

The part that is the major deviation from normal SQL RS work, is how to deploy reports. Even though normal deployment might seem to work, the report won't be recognized by CRM properly.

So, what do you need to do?
1. Create a report that does NOT use a Shared Datasource. Instead create an embedded datasource called CRM that connects to the CRM database server. If you are going to use the Filtered Views, you have to use Windows Authentication. Save and build the new report (DO NOT deploy to the server).

2. Open CRM, Go to "Workplace" and select "Reports". Click "New" in the list. You will see a form where you can select the rdl-file and also select where in CRM the report will be available. Select the rdl-file that resides in the VS Project folder. Press Save.

If, at this point, you had used a Shared Data Source, you would be getting a very complicated error, as described by Menno here: http://blogs.msdn.com/mscrmfreak/archive/2006/04/27/584595.aspx

If all went well, the report will be uploaded correctly.

When uploading the report, CRM will replace the datasource in the rdl with the standard shared datasource. So, your report will still be movable.

Also, when uploading reports like this, CRM will hide all parameters starting with "CRM_". There are several parameters that CRM will fill with data for you if they exisit. For instance the parameter "CRM_URL" will be set to "http:///CRMReports/viewer/drillopen.aspx". This enables the report to create drill-down functionality that loops back into CRM (since there is very good support for URL-addressability in CRM).

Please note that all deployment of reports to CRM should be done in this manner and never directly from Report Designer. This is a bit of a hazzle since it is a bit tedious compared to just deploying from the Report Designer.

In CRM 4 there is a very nice wizard in the application for generating reports, even though it is not nearly as advanced as the report designer.

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

Thursday, January 24, 2008

Integration basics

As I have been writing, I am currently involved in a rather large integration project. For those of you who don't have experience of working with larger integration projects I would like to just share my view of how to set up the architecture connecting Microsoft Dynamcis CRM with the integration engine (BizTalk, WebSphere, Sonic and more). Bellow, I will refer to the Integration Engine, simply as "the Bus"

First of all, communication with the bus can be divided into two different classes:
  1. CRM Initiated Communication
  2. Bus initiated communication

In the picture to the right, these two are represented with a connection each (connection 1 = CRM Initiated Communication, connection 2 = bus initiated communication)

CRM initiated communication might be considered the simplest, since it mainly controlled from CRM. It can be code that runs from aspx-pages, callouts/plug-ins or workflow addons. It simply consumes the webservice at the CRM adapter on the bus.

Bus initiated communication is set up by the bus consuming a customly created web service. This "proxy" webservice translates from integrationmessages and datastructures to CRM native communication.

Integration is then definied by defining messages that uses either connection 1 or 2. Each message has two parts, Request and Response, and the response is the syncronous answer to the request. Assyncronous messages should be set up as two individual messages one for each adapter.

So, why create a proxy web service? Why cannot the bus connect directly to the CRM web service? The reason for this is usually that the communication is defined using messages (as described above) and the person responsible for the CRM Adapter on the bus cannot be expected to have any CRM knowledge in general or specificly CRM Webservice knowledge, hence that is the CRM developers job.

These are some of my experiences and reflections on integration with a centralized integration architecture. If you have any comments or you have some other method that you use, please leave a comment, so that we can discuss it further.




Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

Wednesday, January 09, 2008

Busy, busy + SDK

It has been some time since my last entry and it is mainly due to the fact that I am currently involved up to my ears in two large integration projects with Microsoft Dynamcis CRM 3. Very interesting and demanding but the problems we are facing are mostly project specific and not anything I believe you would find interesting and my customers probably wouldn't want me to talk to much about. When I run into something that I think will be of interest, and I have the time, I will of course let you know.

Personally, I havn't had much time to dig into CRM 4.0 yet but I noticed that the SDK has been released. You can find it here: http://www.microsoft.com/downloads/details.aspx?FamilyId=82E632A7-FAF9-41E0-8EC1-A2662AAE9DFB&displaylang=en

Happy coding!

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com