Request a topic or
contact an Arke consultant
404-812-3123
Microsoft Dynamics CRM 2011

Arke Systems Blog

Useful technical and business information straight from Arke.

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Archive

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Parsing and Validating Phone Numbers in CRM 2011

First off, I would like to thank Joe Gill for getting me started down the right path.  In fact, I'm going to suggest that everyone click that link so you can use his helpful screenshots to navigate where to put the JS I'm about to post. 

In any case, I had not seen a full example of parsing a phone number in CRM 2011 as I had with CRM 4.0.  Since it is such a common need, I decided to make my own.  The following code will strip out all special characters, check and make sure it's a valid set of numbers, and then push it back to the field, parsed properly.  This is limited to 10-digit phone numbers at the moment, but the core structure should be easily expanded if you need different types of validation.

The nice thing is, this can point at any entity, and any attribute that holds a phone number.  I strongly recommend adding this to your standard JS library for all CRM 2011 projects.

function validatePhone(context)
{

var phone =context.getEventSource().getValue();
var sTmp = phone.replace(/[^0-9]/g, "");
phoneRegex = /^\d{10}$/;

if( !sTmp.match( phoneRegex ) )
   {
   event.returnValue = false;
   alert("Phone must contain 10 numbers.") ;
   }
else
  {
   var sTmpClean =  "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) + "-" + sTmp.substr(6, 4);
   context.getEventSource().setValue(sTmpClean);
  }
}


Posted by Wayne Walton on Wednesday, June 22, 2011 4:34 PM
Permalink | Comments (0) | Post RSSRSS comment feed

CRM 2011 - Living in Outlook

Right now, the Microsoft CRM Team is posting videos about CRM 2011.  The most recent one is Living in Outlook.  If you use Outlook and/or CRM at all, prepare to have your mind blown.  The level of integration between CRM 2011 and Outlook is absolutely amazing!  and the best thing is, since it uses Outlook's features to expose CRM data, as Outlook is updated, you get more features in CRM. Of course, that's a double-edged sword.  If you're struck on Outlook 2003, you're not going to get a lot of these cool features, as they disn't exist in Outlook 2003. Here is their full blog post as well: http://blogs.msdn.com/b/crm/archive/2010/10/04/microsoft-dynamics-crm-2011-living-in-outlook.aspx

 
 

Posted by Wayne Walton on Monday, October 4, 2010 4:27 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Internet Explorer 9 Beta and Dynamics CRM

With the release of the Internet Explorer 9 Beta today, I just wanted to make sure that everyone knows not to install IE9 on any machine using CRM Online, CRM 4.0 or testing out the CRM 2011 Beta.  IE9 Beta is currently unsupported for all three CRM environments, and if the IE8 Beta is any indication, it will break things in a big way.

So enjoy testing the Internet Explorer 9 Beta, just don't do it on a machine that uses Dynamics CRM. 


Posted by Wayne Walton on Wednesday, September 15, 2010 12:24 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Dynamics CRM 5 CTP3 announced!

For those of you like me that have been slavering at the chance to get your hands on CRM5 to see everything they've done with it, CTP3 has been announced!  This isn't a public preview yet (we're still months out, there), but it's a start!

When I get a copy, I'll post about some of the best features from a back-end perspective.  I'm especially interested in the application isolation they've been touting for a while now.  To get a taste of what's been announced so far, hit up this announcement from PDC last year.


Posted by Wayne Walton on Thursday, March 25, 2010 9:54 PM
Permalink | Comments (0) | Post RSSRSS comment feed