Hide ms crm picklist items


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);

}

Advertisements

Leave a comment

Filed under MS CRM & Javascript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s