As usual I have been working hard on enhancing and developing new Silverlight applications that interface with MSCRM 2011. I have come accross a weird issue that I was wondering if anyone has experienced before and maybe has a solution. It’s a rare occation that I have to seak a solution off someone else but I’m hoping for some enternal magic here! Allow me to explain, because from the title you might already be thinking I know how to get a Silverlight Application visible on the form!
While using MSCRM 2011 you might have noticed the customize tab that allows you to alter the current area you are in on the fly providing that you have security rights to do so. What do I mean by on the fly? Well lets say you were creating a record and noticed that a field was in the wrong place. As you have the relevant security rights you decide to make the change there and then. So you go to the customise tab, select form and make the change. This saved you the time of having to go to Settings, Solutions, select your solution, select your entity, select forms, select the correct form etc etc…
When registering steps for plugins, you are given the option to select the user the plugin should run as. Your options are bascially calling user or any CRM system user for the organisation you are registering the plugin for. By running the plugin in the context of a user you take onboard that users privilages. For example, if you registered a plugin that creates an account within the context of calling user, and my user triggers the plugin, an account will be created in my name. However if my user doesn’t have permissions to create an account, but we need it to create an account on this trigger we have a slight problem. The plugin will fail creating the account! We can’t change my security roles to allow the creation of accounts as I should not be able to do this. So our only option is to run the plugin in the context of a user that can create accounts. So lets say we have an Administrator user that we will run in the context of. Well now we have introduced the problem that I actually want to talk about!
While testing importing of several small managed solutions I was able to create what is known as a circular reference in software engineering. Take it from me this is bad! When referencing assemblies in Visual Studio it prevents you from creating the circular references, however in MSCRM 2011 it doesn’t seem to prevent and if it does I managed to create a situation where it allows you to create the circular reference. So for MSCRM 2011 I am going to dub this as a circular dependency. Once the circular dependency was created I couldn’t delete or update either solution because they were dependant on each other!
This statement holds true whether you are updating attributes through the SDK dlls or over web services. It doesn’t matter whether you’re coding for a plugin, workflow assembly, Silverlight app or some external custom application like a windows application or web application. The potential outcome in all the scenarios will be the same! What’s the outcome? Triggering other automation unwantedly!