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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Multi Select Option set in Dynamics CRM Online

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

I have the same question (0)
  • Verified answer
    Mahadeo Matre Profile Picture
    17,021 on at

    Hi,

    Check this

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

  • Shaik Profile Picture
    Microsoft Employee on at

    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);

                   }

               });

           }

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans