Show Picklist item in CRM 4.0

 
/* Jscript */

function ShowPickListItem(listID, value)
{
var objList = document.getElementById(listID);

if (objList.SavedList != null)
{
var selValue = null;
var indexInsertion = 0;

for (var i=0; i if (objList.SavedList[i].value == value)
objList.SavedList[i].Visible = true;

// Keep the selected value so we can reselect it after
if (objList.selectedIndex > -1)
selValue = objList.options[objList.selectedIndex].value;
// Remove all the items in the list
for (var i=objList.options.length - 1; i>=0; i--)
objList.options.remove(i);

// Add the items that must be visible
for (var i=0; i {
if (objList.SavedList[i].Visible)
{
var oOption = document.createElement('option');

oOption.text = objList.SavedList[i].Libelle;
oOption.value = objList.SavedList[i].value;

objList.options.add(oOption);
}
}

// Reselect the item that was selected
for (var i=0; i if (objList.options[i].value == selValue)
objList.selectedIndex = i;
}
}