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
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);
}
});
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156