onsdag 9 juli 2014

Upgrade problems from CRM 4.0 to CRM 2013

I have currently been working on an upgrade from CRM 4.0 to CRM 2013 for one of our customers and ran into som unexpected problem when doing the final step of the upgrade from CRM 2011 CRM 2013.

To begin with, when you're doing an upgrade like this, you won't be able to retain any of the code since the JS syntax has changed as well as how you write plugins. This was the first mission which I thought was going to be easiest to do after upgrading the organization to CRM 2011 since all JS libraries are put into web resources and are easier to find. 

At first I couldn't upgrade the organization to CRM 2011 but I thought that if I imported it to our CRM 4.0 server it might be a bit more compliant, possibly due to the fact that we have a higher roll up on that server than the production server that we got the db from. After a bounce on our CRM 4.0 server it imported neatly into CRM 2011.

 The thing that happened then was that I couldn't remove the web resource with an error message saying that it could not find the assembly <name>.dll. It didn't matter if I put the assembly in the assembly folder on the server as it was present on the system I was migrating from I still got the error. It was also impossible to unregister the assemblies with the same error message.
The solution of that problem was to unregister the plugins in CRM 4.0 and do another import to CRM 2011 which worked fine.

Now, after removing all code I did a db backup and restore to the CRM 2013 server running UR2 and tried to import the organization there which gave me the following error:


22:00:14|   Info| Applying slipstream dbUpdates to organization.  Id=82fd6726-2701-e411-960f-00155d0a8302, UniqueName=crmorg.
22:01:37|   Info| CrmAction execution time; InstallDatabaseUpdatesAction; 00:01:23.4180924
22:01:37|  Error| Installer Complete: OrganizationUpgrader - Error encountered
22:01:37|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction
InnerException:
System.Data.SqlClient.SqlException (0x80131904): Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.



This wasn't particularly helpful. After a few tries on different servers running different versions of SQL Server for example I still had the same error. Then my colleague pointed me to Chris Gognettas blog, which again was the saviour of the day.

It appears that at least in UR2 of CRM 2013 there's a check of something which happens to fail if the upgrade from CRM 4.0 to CRM 2011 happened within 24 hours of the upgrade to CRM 2013 you get this error so if you're in a hurry you need to change the datetime field pointed out in Chris' blog, this is an unsupported action so be sure to take backups before you start.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se

tisdag 4 mars 2014

File size limitations in Dynamics CRM

A friend of mine asked me about file size limits the other week and wondered if it was possible to set different limitations on attachments and uploads. This made me start to look for these settings and I didn't find anything.

The scenario my friend was describing was that he wanted to limit file size on email attachemnts but at the same time allowing uploaded files of a larger size than those of the email. Today the only setting on file sizes are that of the attachments to emails and this setting is used for all file size limitations of the entire system, from emails to files you want to add to an account or a contact and also data imports. The latter can be amended somewhat by zipping the file but it might hinder a large data import.

This made me start a ticket on connect so if you have run into these kind of problems or think you might please go to the link below and vote for this issue and it might make it into the program in the future.
https://connect.microsoft.com/dynamicssuggestions/feedback/details/824869/different-file-size-limitations-in-dynamics-crm

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se    

måndag 24 februari 2014

Change AD password on a virtual maching

Real shorty that I just spent 20 minutes to find...

Not CRM per se but to change your AD password on a virtual machine you can't press ctrl-alt-del since the host machine will catch that, instead hit ctrl-alt-end. This is probably well known stuff still it took me a good 20 minutes to find it so I thought I'd put it here as well.


Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se    

måndag 3 februari 2014

CRM adress books in Outlook isn't created for contacts for other organizations than the synchronizing one

I tried to connect to another organization with my outlook client but wasn't able to see the address books as I exptected. I'm not sure how this is supposed to work but these are my findings after a bit of trial and horror

Funny thing, I have our own CRM connected to my outlook and thought I could test a thing with another organization. However when I started Outlook I had a strange setup of the address books. Under the familiar "other address books" there were my normal contact, account and lead address books as per my address book settings. Then there were the new address books of the new organization, accounts, leads, users, queues and facilities but no contacts.
Very strange to me since I have configured the client to only sync accounts, contacts and leads. To me this looks as if the client only take the settings you do in the address book tab of the CRM settings on the synchronizing organization and completely disregards them for any other organization you are connected to with the client. The even more funny thing is that it doesn't add the contacts address book.

The latter is a bit funny but I suppose it means that since you don't synch this organization, you won't copy any contacts and for this reason the address book isn't created either. This seems a bit odd but there is some sort of weird, twisted and annoying logic to it.

NB, I haven't tried this with two CRM 2013 organizations as of yet, this is in CRM 2011.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se    

torsdag 16 januari 2014

HTTP Error 503. The service is unavailable on CRM 2011

Just a quickie. I ran into this error yesterday and was for some reason unable to find much about it so I thought I'd put another source on the web.

The solution in this case was to restart the AppPool for the CRM, which I thought was restarted with an IISreset, but it seems that those are separated. You learn something new every day.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se    

torsdag 19 december 2013

New feature in CRM 2013 on activities

I have been struggling with a problem to relate emails to "parent email", i.e. the email you're replying to, during the past week. The upgrade to CRM 2013 made on of our solutions very much obsolete. The solution of the problem did make me happy though, good work Microsoft!

We created a solution in CRM 2011 where the sender address was set to the address of the queue the email was in instead of the user. This is very much a standard configuration of pretty much ALL ticket systems I have been working in while being a support engineer. That the service parts of CRM doesn't have this feature out of the box is a mystery to me.

The old solution was to use a queryattribute called _InReplyToId, which was the GUID of the email you were replying to. The queryattribute wasn't present in CRM 2013 and I have been looking for a solution ever since. The solution was in fact very simple, Microsoft has provided a connection to parent activity called ParentActivityId. When responding to an email this field is populated with a lookup to the original email, just add the field to the form and you can access this with regular JS code.

To set the sender address to the address of the queue you will have to look up the queue item of the parent email, and fetch the queue from that. I chose to to this with an OData call which I've grown quite fond of the past months.

I think this will help quite a lot and it's really a great feature of the new CRM.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se    

tisdag 17 december 2013

Security roles impact on updated CRM 2011

Since the upgrade from CRM 2011 to 2013 some things have most definitely changed. Some of these changes seems very strange and as soon as the security roles are involved things often are a bit of a challenge to troubleshoot.

One of our customers have a customisation that adds "synchronisation users" to contacts. This is used to sync contacts to more than the owner's outlook. In CRM 2011 there wasn't a problem to add users to the contact with the N:N relation that we created, but after the upgrade they weren't able to add users to the contact.

Of course, when I logged in it was working and since I was using the sysadmin role the answer seemed to reside in the ever so funny security roles settings. It always amuses me to find the correct setting. This time I went through the roles to find the one with least privileges to try to match what was happening. The role I started off with was the CEO-role, which I started stripping of rights until I couldn't add users anymore.
Before I did this manouver I started off by guessing which rights that were needed but since that didn't help I went straight into trial-and-horror-land. The answer confused me a bit at first since the answer was to give users create rights on the user entity. When I opened the search on the quick add field I realized that there was a "new" button at the bottom which probably was evaluated before you could add an existing user.

There is some sort of logic behind this, however it would please me if the "Add existing user" button didn't need a create user privilege to be able to add an EXISTING user. The entire security role part is in my humble opinion somewhat hard to grasp and understand when you move out of the clear areas. To have to have the right to create a user to be able to add an existing one is one of the examples I have encountered during the past years but I could probably make quite a list of these examples.

Happy holidays and great new year!

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se