Today i got requirement to hide some picklist option based on customer type selection(in my case 🙂 ) here is how i did this
like we have one picklist for customer option “A” and “B” and we have a picklist crmpicklistfacility with different facilities like
1 “Create new User”
2 “Modify User”
3 “Delete User”
now we want to present picklist option 1,3 for customer A and 2 for customer B.
we do like this in javascript
var Cust_type=crmForm.all.customertype.DataValue;
var crmpickObj=crmForm.all.facility;
if(Cust_type==”1″)
{
crmpickObj.DeleteOption(2);
}
else if(Cust_type==”2″)
{
crmpickObj.DeleteOption(1);
crmpickObj.DeleteOption(3);
}