I know that MS Dynamics CRM does not support multi-Check boxes out of the box and it require customization.
I followed this blog to try and get the support for it. However it doesn't seem to be working still. I don't get an error on page anymore, but the code simply does not do anything either
Blog: http://blogs.msdn.com/b/crm/archive/2009/03/31/crm-4-0-checkbox-style-multi-select-picklist.aspx
Here is the code i used, there were some syntax changes from the blog that i made.
Once this is loaded into the OnLoad {} section of the form properties nothing happens, at all lol.
Does anyone see anything wrong with this code?
I followed this blog to try and get the support for it. However it doesn't seem to be working still. I don't get an error on page anymore, but the code simply does not do anything either
Blog: http://blogs.msdn.com/b/crm/archive/2009/03/31/crm-4-0-checkbox-style-multi-select-picklist.aspx
Here is the code i used, there were some syntax changes from the blog that i made.
Code:
/*
Checkbox style Multi-Select Picklist
author: Jim Wang @ January 2009
http://jianwang.blogspot.com
*/
// PL - the picklist attribute; PLV - used to save selected picklist values
var PL = crmForm.all.New_ID_Status;
var PLV = crmForm.all.New_Picklistvalue;
if( PL != null && PLV != null )
{
PL.style.display = "none";
PLV.style.display = "none";
// Create a DIV container
var addDiv = document.createElement("<div style='overflow-y:auto; height:80px; border:1px #6699cc solid; background-color:#ffffff;' />");
PL.parentNode.appendChild(addDiv);
// Initialise checkbox controls
for( var i = 1; i < PL.options.length; i++ )
{
var pOption = PL.options[i];
if( !IsChecked( pOption.text ) )
var addInput = document.createElement("<input type='checkbox' style='border:none; width:25px; align:left;' />");
else
var addInput = document.createElement("<input type='checkbox' checked='checked' style='border:none; width:25px; align:left;' />");
var addLabel = document.createElement( "<label />");
addLabel.innerText = pOption.text;
var addBr = document.createElement( "<br />");
PL.nextSibling.appendChild(addInput);
PL.nextSibling.appendChild(addLabel);
PL.nextSibling.appendChild(addBr);
}
// Check if it is selected
function IsChecked( pText )
{
if(PLV.value != "")
{
var PLVT = PLV.value.split("||");
for( var i = 0; i < PLVT.length; i++ )
{
if( PLVT[i] == pText )
return true;
}
}
return false;
}
// Save the selected text, this filed can also be used in Advanced Find
crmForm.attachEvent( "onsave" , OnSave);
function OnSave()
{
PLV.value = "";
var getInput = PL.nextSibling.getElementsByTagName("input");
for( var i = 0; i < getInput.length; i++ )
{
if( getInput[i].checked)
{
PLV.value += getInput[i].nextSibling.innerText + "||";
}
}
}
}
Once this is loaded into the OnLoad {} section of the form properties nothing happens, at all lol.
Does anyone see anything wrong with this code?