Chapter 5. Error Handling

In this chapter we will cover:

  • Handling unexpected user input
  • Handling unexpected processing
  • Blocking events
  • Handling UI events
  • Advanced error handling
  • Adding a new account and contact with validation

Introduction

After focusing on working with standard elements of Dynamics CRM previously, we now turn our attention to unexpected situations in your scripts including a focus on input validation techniques, handling unexpected results, blocking events from taking place, and complex error handling.

Note

All scripting should include error handling. Previous examples did not include error handling to allow for clarity. However, in production, your code should always handle unexpected situations.

Get Microsoft Dynamics CRM 2011 Scripting Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.