locked
Hide Option set value RRS feed

  • Question

  • How to hide the one of the value from option set using JavaScript?

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Yogesh Vijay Mulay

    Friday, April 26, 2013 6:44 AM

Answers

  • try this:

    var control = Xrm.Page.ui.controls.get("new_optionset_field");
     control.removeOption(10000000);


    Hope this helps. If you get answer of your question, please mark the response as an answer and vote as helpful !
    Vikram !

    Friday, April 26, 2013 6:52 AM
  • hi,

    there is no option to hide a value from option set.!

    but you can add/remove options during run time.!

    and also you can disable the item. it will be available in the option set but cannot be selected. check the below code.

    var picklist = document.getElementById("optionset_field");
    picklist[1].disabled = true; // 1 is the index of an item in option set
    //this will disable the item with index "1"


    Thanks and Regards. Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, April 26, 2013 7:20 AM

All replies