This documentation is archived and is not being maintained.

Testing Scripts

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

The Preview feature in the Entity Form Customization page allows you to test your scripts for the OnLoad, OnSave, and onChange events. The OnSave event is simulated in the Preview feature.

The Preview feature gives you the choice to use three different forms: Create, Update, and Read only. These correspond to 3 of the 6 possible FormType property values. Your code should include conditional statements to test for all the possible FormType properties. For more information, see Form Properties.

If your OnLoad event scripts expect to reference existing values in a form using the Update FormType, you will need to publish the customizations and test your scripts using actual data or temporarily transfer your code to a different event so that you can enter the data you expect into the form for testing.

Debugging Scripts

Techniques for debugging scripts associated with form events in Microsoft Dynamics CRM can be performed using this method.

1. Set Internet Explorer settings to enable script debugging.

  1. In Internet Explorer, click Tools and select Internet Options.
  2. On the Advanced Tab, under Browsing locate the Disable script debugging (Internet Explorer) option and uncheck it.
  3. In the script that you want to debug include the following just before the statement where you want to start your debugging session.
  4. When you test your script a list of all the registered script debuggers on your computer will be selected to choose from. Choose your preferred debugger.
  5. When you are finished debugging you can remove or comment out the debugger statement.

For more information about using the debugger statement, see

Disable Microsoft Error Notification

When testing scripts you may want to disable error report notification. By default, Microsoft Dynamics CRM will ask a user for permission to send error reports to Microsoft. This will suppress the normal client errors and display a message to ask the user's permission to send information about the error to Microsoft. You can view details of the error, but they are in an XML format.

If you disable this capability while you are testing your scripts you can view the normal Internet Explorer error messages.

To disable this capability:

  1. On the Tools menu, click Options.
  2. In the Set Personal Options dialog box, on the Privacy tab, select Never send an error report to Microsoft about Microsoft Dynamics CRM.

After you have completed your testing, be sure to set the option back to your preference for normal use.

See Also


Other Resources

© 2010 Microsoft Corporation. All rights reserved.