Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Dynamics CRM 3.0 Client-side Programming: DefaultValue

    Posted on March 3rd, 2006 mitch Print Print No comments

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

     

    Customization, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    1,001 views

    Leave a reply