-
Dynamics CRM 3.0 Client-side Programming: Commenting Your Code
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: /* */
- Single Line: //
The above note caught my attention because I had just ran into an issue regarding the single line comments. I was using it to comment out the last line of an Event and I was getting JavaScript runtime errors. Removing the code that was commented-out stopped the errors.
That's when I realized that CRM 3.0 was removing trailing line breaks from the Event code and turning my Single-line Comment into a showstopper by including the trailing } in the comment and rendering the code "incomplete."
Consistent use of block comments will prevent code issues like this all together and I've had zero issues since I switched.
Customization, Dynamics CRM 1,455 viewsLeave a reply



