I was experimenting with the form control property .DefaultValue last night and found, much to my surprise, that it doesn't work.

From the CRM 3.0 SDK:

{Field}.DefaultValue 

Get/set property.

Specifies the default value for the field.

Ideally, you would put the following code into the Form OnLoad event:

/* if the form type is Create */ 

if(crmForm.FormType == 1)

   crmForm.all.new_myfield.DefaultValue ='Purple';

But, as I mentioned .DefaultValue doesn't work, so use the following:

/* if the form type is Create */ 

if(crmForm.FormType == 1)

   crmForm.all.new_myfield.DataValue ='Purple';

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>