Formatting phone numbers

Working with phone numbers and fax numbers is probably one of the most common tasks users will perform. As such, the system is flexible enough to allow you as a developer to customize these fields to your heart's content.

Getting ready

In order to follow through the steps of this example you need a solution created in your development environment.

How to do it...

The following steps will guide you through adding a JScript web resource that holds your phone number validation and formatting script, as well as associating it with one of the phone number fields on a form.

  1. Open your solution, and create a new JScript resource.
  2. Add the following function to your resource:
    // call this function to format any north american phone number ...

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.