Monday, June 14, 2010

Webservice loading strange workflows

Had an interesting problem today. I want to trigger workflows from an aspx-page by finding the right one by name and for some reason, I got an exception that the workflow had to be flagged to allow manual activation or to be run as a subworkflow. This was very strange since I several times checked the workflow and it was not only published, but both the flags for manual activation and run as sub workflow were checked.

So, I applied my principle of first trying to find where the error was instead of finding what it was.

By tracing and checking some, I found that the webservice actually returned 4 workflows with the exact name I was looking for. I tried to load some of them in the GUI by changing the URL and they did load but they were strange some how since I could not change them. 2 were drafts, 2 were published, 2 were marked as runondemand and 2 were not. The last one proved to be the right one (both published and runondemand).

So, I had to change the code for fetching the GUID for a workflow with a specific name, so that it also checked that the workflow was both published and was allowed to be run on demand. So, if you run into similar problems, you know what to do.

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect
Logica
www.logica.com

Wednesday, June 09, 2010

How to remove a windows service

Today I needed to reinstall CRM on a VPC and for some reason the Async Service wasn't unregistered properly. When I tried uninstalling it using installutil with the following command:

"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil" /u "C:\Program Files\Microsoft Dynamics CRM\Server\bin\CrmAsyncService.exe"


it couldn't find the file. Seemingly, the uninstaller had a job half way and removed the file but not unregistering it as a service. So, how to uninstall? Looking around a bit I found the following command did exactly this:

sc delete MSCRMAsyncService
Good to know, if needed.


Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect
Logica
www.logica.com

Wednesday, March 03, 2010

New version customization manager

My friend and colleague Daniel Halan has released a new version of his program CRM Customization Manager. It is a very very useful tool for handling customizationfiles for Microsoft Dynamics CRM. It can handle exporting from one system and importing to another from the same GUI. You can choose to export only javascripts, you can change the datatype of attributes and keep the data.

It is an essential tool for all Dynamics CRM professionals and Daniel is way to alturistik in my view to be giving it away for free.

You can read more about it and download it here http://blog.halan.se/.

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Monday, March 01, 2010

Reporting Services Windows Service wouldn't start

I created a new differencing disk of a CRM virtual machine today and I had some troubles getting Reporting services up and running. The service simply wouldn't start. I had previously used the same virtual harddisk base for other systems so I found it a bit strange, it should work.

When I looked in the event viewer it showed the error "Report Server (MSSQLSERVER) cannot connect to the report server database.".

I looked around a bit on the net and found a reference to the following which helped:

http://support.microsoft.com/kb/839803

I concernings increasing the timeouts of pipes in the system to 60 seconds instead of 30. This might be needed on VPC:s that are not so fast and might not get the service up and running fast enough.


Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Saturday, February 20, 2010

Marking an appointment as finnished from Outlook

One of the best features of Dynamics CRM is the integration to Microsoft Outlook. In comparisson to competing CRM systems, this is really one of the strongest unique selling points of Dynamics CRM.

However, even though it is really good, there are some parts of it that could use some touchups and until that happens, some workarounds would be good.

One of these issues, is that appointments can easily be created from Outlook and mapped to some object in CRM. This is easy and very few click. Nice. But, when this appointment is completed, it is a bit more complex and a lot more clicky. First you have to open the appointment in Outlook, then open the appointment in the CRM form. From there, you can press the "Save as completed" button, which is a bit tedious and many users find this a bit strange and I am having a hard time explaining why you have to do it this way, it isn't very obvious or logical. The best solution would be that the CRM addin had a button which could mark appointments and other activities as completed. But that just isn't there yet.

So, is there a workaround, yes, of course there is. It isn't perfect, but it will work.

Define some text, like for instance "Completed" and then tell the users to put Completed as the last text in the description field or in the subject field.

Then create a workflow in CRM that triggers for updates on the field where you expect the text. Then let the workflow check if the end of the content of that field is "Completed" and if so, set the appointment as completed.

The same functionality could of course be implemented in a plugin instead, but that requires a bit more programmatic skills.

The functionality of adding a button to Outlook can of course also be developed with Visual Studio Tools for Office (VSTO), and that could of course be used to automatically update the appointment as completed.

So, that might help you out a but I really hope that the CRM Client for version 5 will deliver this functionality since it isn't very hard to do when the rest is there.

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Friday, February 19, 2010

Hybris

A few weeks ago a new colleague started working here at the Dynamics CRM group at Logica Sweden. His name is Fredrik Strandin and he is a very skilled developer. He mentioned that part of the reason he contacted Logica for a position was that he was following this blog and liked it. A huge complement and I am very grateful for it. It is hard to know how many people actually are following this blog and what I write, so please leave a comment if you like. The best inspiration to writing more on the blog is praise from readers of the blog.

I would also like to point out that I really enjoy working for Logica. It is a very friendly company with a very good customer approach. Of course, no company is perfect and a company with 40 000 employees can sometimes be a bit bureaucratic but then again we have resources to approach the largest, coolest and most difficult of CRM projects. So, if you, like Fredrik would like an opportunity to come work with this most extraordinary team of Dynamics CRM professionals, please contact me, we are always looking for driven and skilled people. Just call the main Logica phone number and as for Gustaf Westerlund in Sweden. We have offices in about 40 countries around the world, so it doesn't really matter where you live :).

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Back to old times

Today I got involved in a project I havn't been working in for about 2 years, a CRM 3 project that now was upgraded and there were some issues with callouts not executing properly on the production system but there were no problems on the test system. So, there probably wasn't a code error.

After activating the crm tracing (alway a good thing to do when CRM is missbehavn') it was quite clear that it couldn't find the dll Microsoft.Crm.Platform.Callout.dll which of course is required by CRM 4 if you want to execute workflows since this assembly contains the classes that are inherited from in the callouts. It is a bit strange that this dll isn't included in CRM 4 since callout are supposed to be seemlessly upgradable to CRM 4 and this is the one little stich that is missing. So, just had to dig it up and deploy it to the GAC and the callouts started working as they should.

During this I also thought there might be errors in with the assembly being unsigned and after some looking around, I found that in Visual Studio 2003 it isn't found in the project settings so you have to fix it manually in the assemblyinfo.dll. However, this doesn't seem necessary event though it doesn't hurt.

So, what did I learn?
1. When in doubt, switch on CRM tracing.
2. Make sure you have a good store of all dll:s that CRM uses so that you quickly can find them. How many of you have the Microsoft.Crm.Platform.dll in the CRM 3 hosted version? It is quite rare and can be found on the installation disks but not anywhere on MSDN. If you need it, drop a comment. I approve all comments due to all the #¤#¤¤# comment spammers so you can enter your email and ask me not to publish the comment, and it wont be subject to email harvesters, if you want me to email you the file.
3. Don't take promises of seemless upgradablity too serious. MSFT have done a great job with CRM, you don't even have to recompile (and consider that CRM 3 uses .NET 1.1 and CRM 4 .NET 2.0 from an IIS perspective) so always do a test upgrade a couple of times before you do it live and make sure to write down all the steps you are taking. Let's hope the upgrade from CRM 4 to CRM 5 will be truly seemless!


Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Friday, January 08, 2010

IIS Diag

Christmas has passed and the new year is here, I wish you all a happy and prosperous new year with lots of nice Dynamics CRM business!

We have had some issues with an IIS (Internet Information Server) concerning authentication, application pools, certificates and similar. Since this is quite common and difficult to analyze there is a nice tool from Microsoft to help you with this, the IIS Diag. It can be downloaded here: http://www.microsoft.com/downloads/details.aspx?familyid=9bfa49bc-376b-4a54-95aa-73c9156706e7&displaylang=en.

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Friday, October 23, 2009

Could not find GUID for server...

Interesting error today.

All of a sudden our development server stopped working. We got the following error in CRM:
Microsoft CRM Error Report:



Error Details:


Could not find GUID for server: CRMSERVER$


Full Stack:


[ActiveDirectoryObjectNotFoundException: The local computer is not joined to a domain or the domain cannot be contacted.]


at System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain()


at Microsoft.Crm.BusinessEntities.SecurityUtils.GetGuidFromServerName(String serverName)...
 
It seems that it was caused by the fact the the domain servers DNS was down. I have read of other causes for the same error, but make sure that the DNS service of the domain server is up and running.
 
Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Tuesday, October 20, 2009

SharePoint 2010

The NDA of the new version of SharePoint 2010 has been lifted and hence a lot of new functionality is out!

You can read a lot about it on the SharePoint Team Blog here: http://blogs.msdn.com/sharepoint/archive/2009/10/19/sharepoint-2010.aspx

From a CRM perspective, this is very interesting. The new version of CRM is rumored to have a much tighter integration with SharePoint, so from that perspective it is almost essential to learn a bit more about SharePoint.

There are some areas of SharePoint that are of special interest from a CRM perspective:
  • Enhance BI functionality including performance Point server now included in the new SharePoint
  • Business Data Catalog enhanced - an excellent tool to work with in relations to CRM
  • Enhanced Document Management - one of the weaker parts of Dynamics CRM 4 is the built in document management so integration with SharePoint in regards to document management is often used.
  • Enhanced API and development capabilities. When integration with SharePoint development is often required to create the necessary functionality. The SharePoint API is currently ok but compared to the excellent API of Dynamics CRM, it can do with an upgrade. Hopefully to the mark set by Dynamics CRM.
So that is all good news.

However, there is still one major issue from a CRM - SharePoint integration perspective that Microsoft REALLY need to address and that is the licensing issues of SharePoint users working in a very slight way with CRM data by, for instance, looking at data from a data warehouse in SharePoint with drill-down functionality. Today, all users with access to this need to have a full read only CRM license. Similarly, if there is a webpart used in SharePoint to create leads in CRM, but with no other need for access, a full CRM CAL is required for all users of the Intranet since they are employees and hence cannot use the external connector license. This is preposterous! Please Microsoft, we really like CRM, and we want to pay our dues, just make it fair!


Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

 
Logica
www.logica.com

Sunday, October 18, 2009

Strange problem with Country and Country Code

A couple of days ago I had the wierdest error. We have added some fields on Acccount and a new entity called Billing Account so that there is Contry and Country Code in both. The wierd thing was that when I opened the tab with the field, after about 1 second, the country changed to "United States" and the country code to "1". This even happened to the custom entity.

I was confused. The country code was supposed to be according to the so and so ISO standard, where Sweden is SE. Hence 1 was very incorrect. I started looking if some tired programmer might have added some javascript or similar but found nothing out of the ordinary. Then I though I'd just like to see what happens when I run IE directly from the CRM server, and praise and behold, it didn't change the field! That narrowed it down. First I thought it was google Toolbar, so I uninstalled it, but the error was still there. Then I tried running IE in InPrivate surfing and then it didn't change it! So, there must be some plugin in IE that causes it. After some uninstalling and testing I found it, Swedbank has this "e-kort" or e-card program that let's you generate a one-time VISA number, this was the program that caused this error. It is probably some program this Swedish bank has bought from some american company and it has this weird feature.

Well, that just teaches you, don't install a lot of crap into IE. :)

Gustaf Westerlund
Microsoft Dynamics CRM Chief Architect

Logica
www.logica.com

Create replacement entities

Sometimes, using a standard entity like product or invoice might not be the most optimal choice. Often due to the fact that there is quite a lot of business logic built into these entities. Therefore it is somtimes better to create you own entity instead. However, if you try to create a new entity with the name "Product" you will notice that it cannot be done since there already is an entity with that displayname.

The solution is quite simple, change the displayname of the built in product to "Old product" and remove all rights for all users to it and it will disapear for all normal users. You can then create your new entity with the displayname "Product".

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Friday, October 16, 2009

CRM Customization Manager

My colleague Daniel Halan, has developed a very useful tool for handling customization files. As you might know, the standard tool for this is a bit limited so there is a need for this kind of tool.

Daniel writes a bit more about it on his blog: http://blog.halan.se/post/CRM-Customization-Manager.aspx



Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Friday, October 02, 2009

Off topic: P1i playlist creator

This is a bit off topic but I thought that some of you might be interested anyway. If you don't have a Sony Ericsson P1i or similar, you can stop reading now.

I like to listen to audio books on my Sony Ericsson P1i but it is a bit problematic since the phone doesn't support normal playlists with relative addresses and you cannot select a directory and play all files in the directory either. This is problematic when you have an audio book that you have ripped from your bought CD box since you don't want to play the tracks in any order.

The phone also requires the absolute path of the playlist to use the drive "D:" and nothing else. This is very strange and I think it is a big flaw with an otherwise good phone.

To ease my troubles I created a small program that can create the m3u files in the correct format to support the P1i and I don't see any reason why I shouldn't share it since it only took an hour or two to create.

Just copy the directory with the mp3:s to the memory stick and run the program and select the directory and enter a fitting name for the m3u file and click run. The m3u file is created. Enjoy.

http://www.westerlund.info/files/P1iM3UMaker.zip

Not much CRM or SharePoint but it's free! Right?

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Friday, September 11, 2009

VPC:s and Shared Networking

I used VPC:s all the time and we often clone VPC:s to all project members. However, there is a very tricky part of VPC:s and Microsoft CRM environments and this concerns SID:s.

As you might know, each windows machine has a SID, which is supposed to be a unique identifier for the machine. Exactly when it is used, I am not certain of but I know that you can get into a whole lot of strange trouble if you have two computers with the same SID on the same LAN.

It can easily be changed on any normal windows machine or server with forinstance the tool newsid. However, there is one type of machine that you cannot change SID on and that is a domain controller.

To ease the managing of normal VPC:s it is usually best to create VPC:s that contain everything in one. That is, Windows server, Domain controller, SQL Server, Reporting Services, Visual Studio 2008 and, of course, CRM.

So, we have several VPC:s that have the same SID and we have people sitting next to eachother running them at the same time. The only network setting that can be selected, to still conect to the internet in the VPC is hence, Shared Networking.

This setting is actually a small local network in it self with a NAT (Network Address Translation)/ DHCP server/switch in the VPC host program.

I noticed a problem today when I started up a VPC and noted that I had forgotten to connect the network cable. After I had inserted the network cable and my host PC had full access, I still had problems getting an IP address and a propper connection to the internet from my VPC.

After some fiddeling with trying to run ipconfig /release, ipconfig /renew and sleeping the VPC, I finally shut down the host program and opened the VPC again after which I ran ipconfig /renew, finally it worked.

My interpretation of this is that the NAT/DHCP server need to have a working network connection in the VPC to intitialize properly. Since I didn't, it just miss started and my VPC:s never got any proper IP:s. The only possible way of restarting it is to restart the VPC host program. After it has been started, you just have to run ipconfig /renew to get a new IP from the VPC DHCP/NAT server.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Wednesday, September 02, 2009

Problems with referenced assemblies in plugins

Plugins are a very useful technique and can be used to lots of different things. But sometimes things don't work like you expect them to...

Here at Logica Sweden we have developed a CRM Framework with lots of nice tools to aid your everyday CRM development. The architect behind this hasn't been me but my fellow CRM architect Daniel Halan. This framework is contained in a dll and it is used in plugins.

The problem I was facing was that when I updated the framwork and rebuilt my plugins, to the assembly directory, it also put the framework dll in this directory. But when I tried to run it I got the most weird errors saying that it could not find methods, constructors and similar. If I installed the framework dll in the GAC then it would all work fine. This is something that I would like to avoid, however, since it is a bit cumbersome when developing.

After some collective debugging we found the error, plugins don't use the dll:s in the assembly directory, but the dll:s in C:\Program Files\Microsoft CRM\CRMWeb\bin (or similar depending on where you have installed CRM).

So, make sure you put your referenced dll:s in the correct directory and happy coding!

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Tuesday, July 07, 2009

One of my managers is number 9!

I read David Jennaway's blog today (http://mscrmuk.blogspot.com/) and he was happy that he was listed at 100 on the list of the most influential Dynamics Professionals in the World. I had a look through the list and found that the head of our "Microsoft Empowering Team" at Logica (I represent Dynamics CRM in this team) and also the head of our Dynamics Practice globaly, Thomas Olfsson at position nr 9 in the entire world!

Have a look at the list you self here: http://dynamicsworld.co.uk/index.html

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Friday, June 05, 2009

Workflow scope and security roles

When creating workflows there are some things that have to be taken into account. One thing that you might not know the details about is the Scope in "Options for Automatic Workflows". There are four options that are very similar to the options used for setting up security roles. They are:


- User
- Business Unit
- Parent: Child Business Unit
- Organization

Bellow the selection of the scope, there are some workflow triggering options, like starting the workflow when on create or when an attribute has changed.

The meaning of this is that dependent on the scope you have selected, the triggering will be set up, based on the user who owns the workflow.

So, for instance, if I select "User" in scope and then select triggering on attribute change, and I am the owner of the workflow, then it will only trigger when I make a change to the object.

If scope is set to Organization, it will trigger for all users in the tennant which is why this is most often used. Note however that user is set as default, so you'll have to change this when creating the workflow if you want it to work for someone else than yourself.

This is a useful tool since it can allow powerusers to create their own workflows to help them with their work without actually enabling this for everyone else.

As I have mentioned earlier, the workflow functionality is very powerful, and even thought there are protections agains infinite recursions and such, there is still the risk that semi skilled powerusers creating workflows that put a heavy load on the asyncservice, so I would be a bit reluctant on letting them use this. Thorough training is a must before and try to teach them to keep the workflows simple. If you have several custom workflow activities, for instance, activities for integrating with other systems, I would be very careful since it is hard, if not impossible to restrict a custom workflow activity to just a selected amount of users.

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Monday, June 01, 2009

Internet Facing Deployment

As many of you know, one of the integral and unique parts of Dynamics CRM 4.0 is it's ability to be Internet facing. This does not only mean that you have to choose between the ameneties of a normal AD logon and the grace of IFD, you can have both. So, even if you are just a small company with just a small business version of CRM 4.0 and not a larger corporation, there is no reason why you shouldn't use Dynamics CRM 4.0 with the IFD technology.





So, how do you do it?





There are some good documents provided by Microsoft on how to do it(like this one: http://www.microsoft.com/downloads/thankyou.aspx?familyId=3861e56d-b5ed-4f7f-b2fd-5a53bc71dafc&displayLang=en) but there are some parts of it that are a bit tricky and depend on some of the infrastructure components you have, like DNS, and that might not be Microsoft, or even hosted. So I thought I'd describe a bit about how it works and give an example of how to do it.

First of all you have to do a normal installation of CRM 4.0. You can install on port 5555, 80 or any other TCP port. It doesn't matter for IFD deployment, however, port 80 or 443 have to be made available from the Internet so the physical placement of the CRM server is critical. You can use normal redirect techniques or reverse proxy lookup (as in ISA-server). The important fact is that the server must be placed so that it can be reached from the outside.


The next thing you have to set up is an external name that you can use when adressing the server from Internet, hence it has to be a real name and not just an internal name. If you have registered a domainname you could set a hostname to point to the organizations you want to access.

I used dyndns.com and registered a name like "mydomain" and my CRM organization was mycrm, when using IFD that would make the address for this org:

http://mycrm.mydomain.dyndns.com

Make sure that everything bellow mydomain.dyndns.com also gets redirected to you CRM servers external URL (port 80 or 443 depending on if you are using SSL or not)

The next step is to run the IFD Tool as referenced in the Microsoft Document. It can be downloaded from here.

Use it to set up CRM by setting the right stuff in the web.config and setting some keys in the registry. It is a lot easier than doing it yourself. You have to set it up to the external name you have chosen.

Now the final step is to add a host header in the IIS website for CRM for *.mydomain.dyndns.com or explicitly for mycrm.mydomain.dyndns.com for port 80 or 443 depending on your setup.

Now you should be able to browse to mycompany.mydomain.dyndns.com and get to the logon screen.

To get reports working you have to install the report connector software found on the CRM CD/DVD.

There are of course lot of variations to this, using reverse proxy of ISA Server and all the options of setting up certificates for SSL but I'll leave that out of this posting to keep it simple.

Menno has recently published a posting on this as well (http://www.tekoppele.com/Blog/post/2009/05/30/How-to-configure-an-Internet-Facing-Deployment-for-Microsoft-Dynamics-CRM-40.aspx, and there are several other blogs and MS KB articles concerning this. If you have problems, try taking it a step at a time and analyse and design the setup first so that you have got it figgured before you start configuring!

Good luck!



Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com

Friday, May 08, 2009

Enhancing performance in virtual machines

I follow the blog Microsoft Dynamics CRM UK Blog which is very good and they had an interesting posting today concerning performance issues in virtual PC 2007 on laptops. As most consultants, I use one (a lenovo T61p). You can read more about it here: http://blogs.msdn.com/ukcrm/archive/2009/05/07/virtual-pc-2007-performance-tweaks.aspx

When I tried to apply the change to the file they mentioned (%appdata%\Microsoft\Virtual PC\options.xml) I had a problem since I didn't have the parent tag in my file. I checked around a bit and found that it could just be added to the main structure. So, after modifications, my file looked like this:

----
</virtual_network>
<virtual_machines>
<enable_idle_thread type="boolean">true</enable_idle_thread>
</virtual_machines>
<window>
---

I would recommend adding it, if you most of the time have the computer connected to the power outlet, since it will probably increase the performance of your virtual machines!

Gustaf Westerlund
Microsoft Dynamics CRM Architect

Logica
www.logica.com