Step 1 : The first thing we’ll need to do is create two custom fields
a) Create a OptionSet field and populate it with some value say field is “new_SelectOption”
b) Create a MultiLineTextBox to store string of values selected from the OptionSet say “new_SelectOptionValue”
Step 2 : Put the OptionSet Field on the Entity Form
Step 3 : Create a JavaScript web Resource and add the following sample code
onLoad Event : function ConvertToMultiSelectCheckBox( ) { OSet=document.all.new_SelectOption; //get OptionSet field object OSetValue=document.all.new_SelectOptionValue; //get MultiLineTextBox field object if( OSet != null && OSetValue != null ) { OSet.style.display = "none"; Xrm.Page.getControl("new_SelectOptionValue").setVisible(false); //Hide the control // Create a DIV var addDiv = document.createElement("<div style='overflow-y:auto; height:80px; border:1px #6699cc solid; background-color:#ffffff;'/>"); OSet.parentNode.appendChild(addDiv); // Initialise checkbox controls for( var i = 1; i < OSet.options.length; i++ ) { var pOptionSet = OSet.options[i]; if( !IsChecked( pOptionSet.text , OSet, OSetValue) ) { var addInput = document.createElement("<input type='checkbox' onclick='OnCheckChangeEvent()' style='border:none;width:25px; align:left;' />" ); } else { var addInput = document.createElement("<input type='checkbox' onclick='OnCheckChangeEvent()' checked='checked' style='border:none; width:25px; align:left;' />" ); } var addLabel = document.createElement( "<label />"); addLabel.innerText = pOptionSet.text; var addBr = document.createElement( "<br/>"); OSet.nextSibling.appendChild(addInput); OSet.nextSibling.appendChild(addLabel); OSet.nextSibling.appendChild(addBr); } } } function OnCheckChangeEvent() { OSet=document.all.new_SelectOption; var getInput = OSet.nextSibling.getElementsByTagName("input"); var result = ''; for( var i = 0; i < getInput.length; i++ ) { if( getInput[i].checked) { //selected values are stored as semi-colon delimited values result += getInput[i].nextSibling.innerText + ";"; } } //Save MultiLineTextBox data into the database control = Xrm.Page.getControl("new_SelectOptionValue"); attribute = control.getAttribute(); attribute.setValue(result); } // Check CheckBox is Checked or Not function IsChecked( pText , OSet, OSetValue) { if(OSetValue.value != "") { //selected values are stored as semi-colon delimited values var OSetValueT = OSetValue.value.split(";"); for( var count = 0; count < OSetValueT.length; count++ ) { if( OSetValueT[count] == pText ) return true; } } return false; }