Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

how i created Dropdown list?

Posted on by 105

hello,

       I am new on dynamic crm , help me for creating dropdown list on header form .

 i will create option set values in lead source field , and i add another field sub resource 

in that if i select in lead source WEB then populate dropdown list in sub resource, how i work on this and what i do ...

thanx in advance.

*This post is locked for comments

  • Verified answer
    nil_wagh Profile Picture
    nil_wagh 105 on at
    RE: how i created Dropdown list?

    function dependentOption()

    {

      var control = Xrm.Page.getAttribute("leadsourcecode").getValue();

      var val1={value:1, text:"Inbound"};

      var val2={value:2, text:"Outbound"};

      if(control==1)

      {

             var text1=Xrm.Page.getControl("new_subresource");

     if(text1==null)

     {

     text1.addOption(val1);

     text1.addOption(val2);

     }

     else

     {

    //return false;  

     }

      }

      else

      {

      }

    }

    i will write this code but 'addOption' cant working in dynamic 365

  • Verified answer
    nil_wagh Profile Picture
    nil_wagh 105 on at
    RE: how i created Dropdown list?

    yes I understand this scenario but i cant elaborate by javascript

  • Verified answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: how i created Dropdown list?

    If the dependent optionset does not work for you then we can do a separate JS solution.

    In the first dropdown you would have values such as

    1 - Option 1

    2 - Option 2

    3 - Option 3

    In the second drop down you would have values such as

    101 - Option A for 1

    102 - Option B for 1

    201 - Option A for 2

    ...

    You can then on the change event of first optionset, remove the unnecessary values from second option set.

    The only issue here, is that if you select Option 1, and you made a mistake and want to select option 2, you are not going to be able to, since you already removed the data, so on the first selection, you will need to "backup" your optionset data into an object/array/json...

    Let me know if you need additional help.

  • nil_wagh Profile Picture
    nil_wagh 105 on at
    RE: how i created Dropdown list?

    yes its dependent option set ,

    but difference is to when select option in Lead source then display dropdown list in Lead sub source field and again change option then display another dropdown list ....is it complete by javascript if yes then what is the javascript for that ?

  • Verified answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: how i created Dropdown list?

    I think what you are looking for is dependent option sets.

    Take a look at this tool by Guido Preite:

    crmoptionsets.azurewebsites.net

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans