locked
Customizing Option Sets in Managed Solutions RRS feed

  • Question

  • Hi

    I have created an unmanaged solution in order to carry out all our development for a particular project.  As part of that project we have used the CustomerTypeCode attribute on Account.  We have added and amended all the values within this optionset. 

    The problem that I have is that I have exported this solution as managed, and deployed to the customers production server.  Knowing that the client would want to modified option set values, I made them customizable within the solution, so the client has therefore modified/removed and added values to the CustomerTypeCode option set.

    OK to my question.  If I deploy  a new version of the solution onto their server, and during install selected to "override customisations" (there is a valid reason for this), the values that the client entered still appear in the list.  Surely this should only be the case if i had selected to Merge the customizations.  As a test I also merged the customisation and I cannot see any difference.

    Can anybody explain to me why by selected "Override Customizations", customisations that the client has made to the option set are not removed.

    If I have not provided enough information then please ask, and I will provide you with whatever information you require.  This issue is causing me a major problem and I cannot understand what is happening.

    Thanks in advance

    Paul


    Paul

    Monday, April 9, 2012 3:06 PM

All replies

  • Hi,

       option set values seem to be handled in a bit different way as far as I understand. For instance, even if you defined a totally new option set and allowed customizations on that option set(I think CustomerTypeCode is actually available in the default solution), "overwrite customizations" option would only affect changes in the description/display name of the option set, but it would not affect option values.



    Alex Shlega, GotchaHunter.Net


    Monday, April 9, 2012 7:16 PM
  • Hi Alex

    Thanks for the reply.  I have done some more investigation, using 2 clean environments.  It appears that following a deployment of a managed solution ( containing just the account entity) if I make changes to an option set ( CustomerTypeCode for example).  If I then re-import the same solution using "Override Customisations" any updates and additions are deployed, however the item that I had removed from the option set now appears first in the list.

    It appears that you cannot remove option set items from a solution.

    Any Ideas ?


    Paul

    Monday, April 9, 2012 7:37 PM
  • Hi Paul,

      just a thought.. write a plugin:) 

      Use RetrieveMultiple(and, maybe, Retrieve) message on the "solution" entity.

      That plugin will fire right after the solution is imported (once CRM tries to update the list of solutions)

      In the plugin, update/order your option set (here is a link: http://msdn.microsoft.com/en-us/library/gg334416.aspx)

      And here is another link(how to write a plugin for "retrieve": http://davecorun.com/blog/2012/01/05/crm-2011retrieve-plugin/)

      Before doing anything with the option set in the plugin, see if it has been updated already. 

      From the performance standpoint, it won't be too bad - most likely, your client won't be working with the solutions too often. 

    PS. You'll have to add your plugin to the solution, and you'll also have to add a message step to that solution. When importing the solution, your client will need to select "enable processes.." checkbox.

      


    Alex Shlega, GotchaHunter.Net

    Tuesday, April 10, 2012 3:53 AM
  • Thanks Alex.  I was looking for more of a process, because the client is going to be updating a lot of option sets throughout the system, and I do not want to code default values for all of them.

    Thanks for the suggestion.

    Paul


    Paul

    Tuesday, April 10, 2012 8:39 PM