Friday, 27 May 2011

Add/Remove values from Drop Down box at Run Time in MSCRM


Add/Remove values from Drop Down box at Run Time in MSCRM

//Write this code on Change Event of Main Drop Down Box, It will change the value in second drop down.

crmForm.all.leb_subcategoryoftopup.remove(0);
crmForm.all.leb_subcategoryoftopup.remove(1);
crmForm.all.leb_subcategoryoftopup.remove(2);
crmForm.all.leb_subcategoryoftopup.remove(3);
crmForm.all.leb_subcategoryoftopup.remove(4);

if(crmForm.all.leb_reasonfortopup.DataValue <5){
crmForm.all.leb_subcategoryoftopup.disabled=true;
}
else
{
crmForm.all.leb_subcategoryoftopup.disabled=false;


if(crmForm.all.leb_reasonfortopup.DataValue ==5)
{
crmForm.all.leb_subcategoryoftopup.AddOption("Smile Call Offer", 1);
crmForm.all.leb_subcategoryoftopup.AddOption("Complaint Compensation", 2);
crmForm.all.leb_subcategoryoftopup.AddOption("Promo Credit", 3);
}

if(crmForm.all.leb_reasonfortopup.DataValue ==6)
{
crmForm.all.leb_subcategoryoftopup.AddOption("False Answer refund", 4);
crmForm.all.leb_subcategoryoftopup.AddOption("Expired Balance Transfer", 5);
crmForm.all.leb_subcategoryoftopup.AddOption("Lost/Stolen Balance Transfer", 6);
crmForm.all.leb_subcategoryoftopup.AddOption("Voucher Error/Blocked", 7);
}

if(crmForm.all.leb_reasonfortopup.DataValue ==7)
{
crmForm.all.leb_subcategoryoftopup.AddOption("Expired Balance Transfer", 8);
crmForm.all.leb_subcategoryoftopup.AddOption("Balance Correction", 9);
crmForm.all.leb_subcategoryoftopup.AddOption("Online Top-up Decline", 10);
}



}

No comments:

Post a Comment