How to enable/Disable Fields in MSCRM 4?

April 21, 2009 at 4:55 pm | Posted in Uncategorized | Leave a comment

Hi Guys,

 

       We had a requirement that we have to enable a  field in our CRM system based on the value selected by the user in picklist. 

    Seems Easy. Our team struck up with this for 2 days, frankly speaking our team members  are novice to programming and finally they approched me for a solution and i solved it in little time. 

I then decided to blog this and share this to you all.

    I did the following things.

1) I created a new field named OTHERS and made it disabled using OnLoad          event of the form using the code below

crmForm.all.new_others.Disabled = true;

2) Then i put the following code in my OnChange event of  the desired picklist (ie) new_erp. 

if(crmForm.all.new_erp.DataValue == 7)

{  

 crmForm.all.new_others.Disabled = false; // to enable 

  }

else

{

crmForm.all.new_others.Disabled = true; // to enable 

}

That’s it you are done guys.

 

                          Cheers.

Advertisements

Leave a Comment »

RSS feed for comments on this post. TrackBack URI

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

Create a free website or blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: