web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

how i created Dropdown list?

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

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

    Take a look at this tool by Guido Preite:

    crmoptionsets.azurewebsites.net

  • nil_wagh Profile Picture
    105 on at

    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 - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Verified answer
    nil_wagh Profile Picture
    105 on at

    yes I understand this scenario but i cant elaborate by javascript

  • Verified answer
    nil_wagh Profile Picture
    105 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans