Friday, September 21, 2007

System Customizer Role

I had a client recently go through and clean up the Roles of CRM because they were creating so many new roles that the list as getting a little unwieldy. I always recommend that the system roles should be left in tact and untouched so that they can be used as templates to copy new roles from. Well, sometimes curiosity gets the best of us and I recently found out what happens when you delete system roles.

At first you notice no difference. Records still stay in tact, can be viewed, updated, deleted, etc with no problem. However if you try to create a custom entity and the "System Customizer" role is gone (this also goes for the "System Administrator" role but Microsoft has locked down the deletion of that role) then CRM will throw an error at you telling you to contact your system administrator. A great error message that gets you no closer to figuring out your problem.

After a bit of searching I found the following:

Microsoft KB article 934690:
When a custom entity is created, Microsoft Dynamics CRM automatically grants the System Customizer role access to the new entity. If you delete or edit the System Customizer role, you receive the error message that is mentioned in the "Symptoms" section.

Microsoft has a hotfix for this issue (because apparently I wasn't the only curious one out there) but you have to contact MS Support in order to obtain the hotfix. From my other searchings, your other option is to back up CRM, uninstall CRM, install CRM fresh and then migrate all of your data from the back up into the new system. If you restore your DB's then you will once again be missing the "System Customizer" role so that will get you nowhere.

Oh, and in case you're wondering, you can't just recreate a "System Customizer" role manually. I tried to copy the "System Administrator" role, name it "System Customizer" and then tried to create a custom entity. I got the same error as I had received before. Whatever script Microsoft has running in the background looks for the GUID of the "System Customizer" role instead of the name. So, while I thought I had a nice quick fix it tuned out to not do anything at all.

So, this is my warning to all of you, DON'T DELETE ANY OF THE OUT-OF-THE-BOX ROLES. I don't know of any other issues with any of the other roles yet but that doesn't mean that there aren't any other similar issues like this. It doesn't cost anything to just leave the system roles there and let them be but it will cost you a bit of grief to get them back and get your system back up to full running capabilities.

Hope this helps someone and kills your curiosity on this subject.

David Fronk
Dynamic Methods Inc.

4 comments:

Andreas Munch said...

Where can I get this patch? I'm having the same problem.

Dynamic Methods said...

Actually, it's not really a "patch" but more of a SQL query that you obtain from MS Support. I would suggest opening a ticket with MS CRM Support requesting the fix for the System Customizer role having been deleted. They will then provide you with the fix (a SQL query) that you run to fix your system. They should not charge you for the ticket as it is a known fix that they provide.

David Fronk
Dynamic Methods Inc.

Anonymous said...

A more simple solution is just to export the role from another CRM install and import it. No need to re-install and migrate. While I understand you concerns, getting rid of the other roles make wonders for performance, espeically if you have a very deep hierachy of business units.

Dynamic Methods said...

That works in CRM 4.0, but if someone does this in CRM 3.0 importing roles doesn't exist. But for CRM 4.0, yes importing a role from another system would work just fine. One other option is if you catch it soon enough you could just switch the DeletionStateCode from 2 to 0 through SQL (unsupported) and that should work as well.

I didn't know that performance improves if you do that, I'll have to try that.

Thanks for the tips,

David Fronk
Dynamic Methods Inc.

Post a Comment