Working with Microsoft Dynamics(TM) CRM 3.0

In this section, we will review some useful tips we've discovered when working with client-side scripts. These topics include:

Development Environment

We recommend that you create your scripts in an external editor instead of attempting to write code directly in the Microsoft CRM Event Detail Properties dialog window. Common script editor choices would be Microsoft Visual Studio .NET, Microsoft Office FrontPage, and Notepad. We recommend that you write your scripts in an external editor for the following reasons:

Languages

Microsoft CRM renders event scripts on the client-side of the browser, so you must use a scripting language compatible with Internet Explorer (such as Microsoft JScript or JavaScript). Microsoft CRM provides no validation of your script; it merely renders the script out to the resulting HTML page. Therefore, you can use the scripting language that you're most comfortable with or that your business logic requires.

Testing and Debugging

Any developer who has received an emergency call on the weekend about a coding or system problem knows the importance of thoroughly testing your code! Because Microsoft CRM does not validate any script code, you are responsible for ensuring that your scripts will work with Microsoft CRM. We recommend the following test techniques when developing your custom scripts:

Tip 

If you are new to scripting languages, you should be aware that both JavaScript and Jscript are case-senstive. So, <field>.SetFocus() will properly move the mouse cursor to the field, while <field>.setfocus() will do nothing!

Additional Resources

The following list provides some additional information regarding the topics discussed in this chapter:

Категории