Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Multi Select Option set in Dynamics CRM Online

Posted on by

Hi All,

Is it possible to have Multi Select Option set in Dynamics CRM Online? If not what are the workaround we have ? Any inputs/pointers are appreciated

Thanks,

Shaik

*This post is locked for comments

  • Shaik Profile Picture
    Shaik on at
    RE: Multi Select Option set in Dynamics CRM Online

    Hi Mahadeo Matre - Took help of your blog, I see couple of syntax issues. I have corrected in the below code. Please compare and update your blog so that it can save some more time :-)

     //Coverts option list to checkbox list.

           function ConvertDropDownToCheckBoxList() {

               var dropdownOptions = parent.Xrm.Page.getAttribute("wbg_geographicscope").getOptions();

               var selectedValue = parent.Xrm.Page.getAttribute("wbg_geoselectedvalues").getValue();

               $(dropdownOptions).each(function (i, e) {

                   var rText = $(this)[0].text;

                   var rvalue = $(this)[0].value;

                   var isChecked = false;

                   if (rText != '' && rText !='Cross Regional') {

                       //if (selectedValue != null && selectedValue.indexOf(rvalue) != -1)

                           isChecked = true;

                       var checkbox = "<input type='checkbox' name='r' />" + rText + "</br>"

                       $(checkbox)

                           .attr("value", rvalue)

                           .attr("checked", isChecked)

                             .attr("id", "id" + rvalue)

                           .click(function () {

                               //To Set Picklist Select Values

                               var selectedOption = parent.Xrm.Page.getAttribute("wbg_geoselectedvalues").getValue();

                               if (this.checked) {

                                   if (selectedOption == null)

                                       selectedOption = rvalue;

                                   else

                                       selectedOption = selectedOption + "," + rvalue

                               }

                               else {

                                   var tempSelected = rvalue + ",";

                                   if (selectedOption.indexOf(tempSelected) != -1)

                                       selectedOption = selectedOption.replace(tempSelected, "");

                                   else

                                       selectedOption = selectedOption.replace(rvalue, "");

                               }

                               parent.Xrm.Page.getAttribute("wbg_geoselectedvalues").setValue(selectedOption.toString());

                               //To Set Picklist Select Text

                               var selectedOptionText = parent.Xrm.Page.getAttribute("wbg_geoselectedtext").getValue();

                               if (this.checked) {

                                   if (selectedOptionText == null)

                                       selectedOptionText = rText;

                                   else

                                       selectedOptionText = selectedOptionText + "," + rText

                               }

                               else {

                                   var tempSelectedtext = rText + ",";

                                   if (selectedOptionText.indexOf(tempSelectedtext) != -1)

                                       selectedOptionText = selectedOptionText.replace(tempSelectedtext, "");

                                   else

                                       selectedOptionText = selectedOptionText.replace(rText, "");

                               }

                               parent.Xrm.Page.getAttribute("wbg_geoselectedtext").setValue(selectedOptionText);

                           })

                           .appendTo(checkboxList);

                   }

               });

           }

  • Verified answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Multi Select Option set in Dynamics CRM Online

    Hi,

    Check this

    mahadeomatre.blogspot.com/.../convert-option-set-to-multi-select.html

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans