Wednesday, April 20, 2011

Disable Field In Microsoft CRM 2011

As I have shifted to Microsoft CRM 2011 due to change of my job. Now I will give you some tips regarding MS CRM 2011 from here onword and also Silverlight as well because of the nature of the job. Here is my first post regarding MS CRM 2011 which is how to disabled field on the form using javascript. The code is listed below

List 1
In the List 1 you can see I have define a javascript function which will take two parameter with the name of pickListName and the fieldName. picklistName is the name of the picklist which is used to enabled disabled the field. I have 2 values in the pickList based on the selected value I have endabled disabled the field on the form. First I have check for the null value as I have added empty string in the picklist for no selection.

All and any comments / bugs / suggestions are welcomed!

3 comments:

Anonymous said...

Hi,
I'm new to CRM2011. Can you explain the Xrm object that is used in your code? Where has it been defined etc?

Asim Sajjad said...

@Anonymous:The Xrm.Page object provides a hierarchy of objects that can be used to interact with Microsoft Dynamics CRM 2011 forms.

Anonymous said...

l have picklist with 2 values and under this picklist i have a 2 fields i want when i click in the first values in the picklist the second fiels turn desable and same when i choose the second in the picklist the first in field turn desable

thx for your help