locked
Possible to populate option set using JScript or XML? RRS feed

  • Question

  • Hello,

    I was wondering if what I ask for in the title is possible. I need to make a dependent option set, the way I've been doing it was filling out the option set with values then using JScript to take care of what shows up depending on the value being selected. Wanted to know if it was possible to have a JScript or XML and then load the values/options onto the option set field.

    Thanks

    Monday, March 24, 2014 4:11 PM

All replies

  • Hi TeaYou,

    If you're planning to populate a optionset using JScript (without the values actually being in the optionset), you can do that by adding options like you do for normal select elements in HTML. If you're using CRM 2013, you can use the adoption XRM method to add options to optionset. But then again, in order for you to preserve the selected data, you need to store it in a hidden textbox field in the CRM form. If you do not store it anywhere, there is no way the selected data will be stored anywhere in CRM, since the selected value actually doesn't exist in the optionset values. Also, if you plan on reading the values from a separate .xml file as Web Resource in CRM, I do not think there is a way to read XML files using JScript.

    Does that answer your question?


    Admin QuikView Solution for CRM 2013



    Monday, March 24, 2014 4:52 PM
  • Hello,

    1. First you need make sure you understand you can only add items to optionset dynamically that are added to it's metadata already.

    2. You can have xml webresource and can read that using js code

    3. Did you think of trying filtered lookup to implement your requirement.

    4. You can also develop custom web resource to implement your requirement, keeping first 1 limitation in mind.


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, March 25, 2014 2:09 AM
    Moderator