Archive for March 3rd, 2006

I was browsing the CRM 3.0 SDK the other day and ran across the following little tidbit:
Another improvement in scripting is that when you edit scripts, all formatting is retained to improve readability and maintainability.
Note   Use of /* … */ style comments is preferred in scripts.

If you didn't know, JavaScript supports two kinds of comments:

Block: /* [...]

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 [...]