locked
CRM 2011 - Knowledge base question on Option Set field (Overriding default range) RRS feed

  • Question

  • Experts/Gurus,

    Would really appreciate if you can share your thoughts on this particular knowledge base question, it's relate with Option Set fields.

    Typically by default, when we create Option Set fields, the Value (284,200,000) is derived from default solution, as you can see in screen shot below:

    Now if i try to change the value to, lets say 0, then i get following message:

    The confirmation message is recommending me to use the range specified in the default solution range. But i want to use value = 0.
    The system would let me do it, which is fine.


    My question is:

    Is it safe to do this? What are the consequences of using 0 (worst case). The min value i can have in default solution is 10,000.
    The reason why i am asking is we are building a product where those option set values = 0,1,2 has to be in sync in order with Dynamics NAV option sets (through connector). 

    Would really appreciate if you all experts can share your thoughts and recommendations?

    Kind Regard,
    Sam


    Always feels great when your efforts are appreciated or at least what you have done may have helped somebody, so please VOTE AS HELPFUL if applicable.

    Tuesday, November 27, 2012 11:34 PM

Answers

  • So unreal, nobody has read my post and everybody is posted same thing in circles :)
    I was asking the merits of overriding those option value numbers.

    Anyway we are all set on this, i have already changed the numbers to 0,1,2...

    I will close the issue.


    Always feels great when your efforts are appreciated or at least what you have done may have helped somebody, so please VOTE AS HELPFUL if applicable.

    • Marked as answer by itsgonabeme Monday, February 25, 2013 10:04 PM
    Monday, February 25, 2013 10:04 PM

All replies

  • Hi Sam

    you could try creating the Option Set from code.

     // Connect to the Organization service. 
                    // The using statement assures that the service proxy will be properly disposed.
                    using (_serviceProxy = ServerConnection.GetOrganizationProxy(serverConfig))
                    {
                        // This statement is required to enable early-bound type support.
                        _serviceProxy.EnableProxyTypes();
    
                        //<snippetCreateOptionSet1>
    
                        // Define the option set to create.
                        OptionSetMetadata setupOptionSetMetadata = new OptionSetMetadata()
                        {
                            // The name will be used to uniquely identify the option set.
                            // Normally you should generate this identifier using the publisher's
                            // prefix and double-check that the name is not in use.
                            Name = _optionSetName,
                            DisplayName = new Label("Example Option Set", _languageCode),
                            Description = new Label("An Example Option Set", _languageCode),
                            IsGlobal = true,
                            OptionSetType = OptionSetType.Picklist,
    
                            // Define the list of options that populate the option set
                            // The order here determines the order shown in the option set.
                            Options = 
                        {
                            // Options accepts any number of OptionMetadata instances, which
                            // are simply pairs of Labels and integer values.
                            new OptionMetadata(new Label("Option 1", _languageCode), 1 ),
                            new OptionMetadata(new Label("Option 2", _languageCode), 2 )
                        }
                        };
    
                        // Wrap the OptionSetMetadata in the appropriate request.
                        CreateOptionSetRequest createOptionSetRequest = new CreateOptionSetRequest
                        {
                            OptionSet = setupOptionSetMetadata
                        };
    
                        // Pass the execute statement to the CRM service.
                        _serviceProxy.Execute(createOptionSetRequest);
                        Console.WriteLine("Option Set created");
    
                    }
     

    This is from the SDK.

    Wednesday, November 28, 2012 5:50 AM
  • Hi,

    Thanks for sharing your thoughts, yes i am aware of this code. My question was not about creating option set through code, but i was asking the merits of overriding the option set values 0. Can you please go through my post one more time.

    Thanks,
    Sam


    Always feels great when your efforts are appreciated or at least what you have done may have helped somebody, so please VOTE AS HELPFUL if applicable.

    Wednesday, November 28, 2012 5:53 AM
  • Hi Sam,

    You can define the default value(option set prefix) for Option Set fields for each solution publisher (default value is from 10000 to 99999). In your case you have defined as 284200.

    While defining OptionSet Options we can override the default value to any number like 0, 1 ,2, 3 etc. You will get an alert saying default value is 284200 but it allowed to alter and at platform level you will have no issue. 

    For each OptionSet Option there is a separate entry in database Stringmao table. And all CRM APIs will support OptionSet OptionValue and OptionName. 




    Chandan

    Wednesday, November 28, 2012 6:06 AM
  • hi

    we can add prefix values for option set from publisher as you can see below screen shot

    tange is from 10,000 to 99,999

    see below screen shot


    Please don't forget to Vote and marked as answer If this post answers your question or was helpful, please click "Mark As Answer" on the post and "Mark as Helpful" Be wise

    Wednesday, November 28, 2012 11:23 AM
  • So unreal, nobody has read my post and everybody is posted same thing in circles :)
    I was asking the merits of overriding those option value numbers.

    Anyway we are all set on this, i have already changed the numbers to 0,1,2...

    I will close the issue.


    Always feels great when your efforts are appreciated or at least what you have done may have helped somebody, so please VOTE AS HELPFUL if applicable.

    • Marked as answer by itsgonabeme Monday, February 25, 2013 10:04 PM
    Monday, February 25, 2013 10:04 PM