Phone number normalizing and auto-formatting

 I really appreciate the way that Outlook auto-normalizes phone numbers - 
for example, here in the US, I can enter 5555555555 and Outlook 
automagically formats that to (555) 555-5555.

Why CRM 3.0 doesn't do this out of the box is strange but if anyone has 
ideas on how to implement, that'd be greatly appreciated.  I've worked very 
hard to normalize all my data before import, but I know it's a matter of 
time before our users (ok, our sales people) destroy all that hard work by 
entering garbage into every phone field entry that the system cannot 
auto-normalize and error check for them.

Thanks - Daniel 


0
Daniel
2/12/2006 1:49:14 AM
crm 35858 articles. 1 followers. Follow

8 Replies
725 Views

Similar Articles

[PageSpeed] 37

Just write some simple On Save event code to format the phone
numbers.....and Daniel, after reading a bunch of your posts, I'd would
suggest that you invest in some implementation/customization training
like many of those on this forum have done to learn the ins and outs of
the product. It will make your life much easier. No disrespect meant
just some friendly advice.

0
SteveT
2/12/2006 2:13:50 AM
I've already spent enough money and time - I do not expect to be forced to 
pay for training simply because Microsoft did not produce sufficient support 
documentation when they released the product.

There are two types of people that work with technology - those who have to 
go to training to learn everything/most things (who usually work for big 
companies, with fat budgets) and those who do it themselves, by reading the 
manuals, or going online.  I used to work for one of those huge companies, 
where the money flowed freely and people (myself included) took all that 
training for granted.

Today though, I happen to work for (and own) a small business where we don't 
have that luxury, so it's easier said than done to tell someone to go pay 
for training - it's simply not always practical.  I'm perfectly happy going 
it alone if a product has good documentation.  By most accounts, CRM 3.0 
does not (yet).

Since the documentation that shipped with CRM 3.0 is lacking, I've had to go 
online for most things and it's starting to take, but it would have been 
nice if MS shipped the product with complete manuals, like most of their 
traditional client/server apps and platforms.

Daniel

"SteveT" <drumguy61-google@yahoo.com> wrote in message 
news:1139710430.903325.300920@o13g2000cwo.googlegroups.com...
> Just write some simple On Save event code to format the phone
> numbers.....and Daniel, after reading a bunch of your posts, I'd would
> suggest that you invest in some implementation/customization training
> like many of those on this forum have done to learn the ins and outs of
> the product. It will make your life much easier. No disrespect meant
> just some friendly advice.
> 


0
Daniel
2/12/2006 3:26:23 AM
I found that this script did the trick (replace 310 with your area code):

// Get the field that fired the event.
var oField = event.srcElement;

// Validate the field information.
if (typeof(oField) != "undefined" && oField != null)
{
// Remove any nonnumeric characters.
  var sTmp = oField.DataValue.replace(/[^0-9]/g, "");

// If the number has a valid length, format the number.
  switch (sTmp.length)
  {
    case "4105551212".length:
      oField.DataValue = "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) 
+ "-" + sTmp.substr(6, 4);
      break;

    case "5551212".length:
      oField.DataValue = "(310) " + sTmp.substr(0, 3) + "-" + sTmp.substr(3, 
4);
      break;
  }
}

"Daniel" <nospam_no@no.com> wrote in message 
news:OOQTKa3LGHA.3408@TK2MSFTNGP12.phx.gbl...
> I really appreciate the way that Outlook auto-normalizes phone numbers - 
> for example, here in the US, I can enter 5555555555 and Outlook 
> automagically formats that to (555) 555-5555.
>
> Why CRM 3.0 doesn't do this out of the box is strange but if anyone has 
> ideas on how to implement, that'd be greatly appreciated.  I've worked 
> very hard to normalize all my data before import, but I know it's a matter 
> of time before our users (ok, our sales people) destroy all that hard work 
> by entering garbage into every phone field entry that the system cannot 
> auto-normalize and error check for them.
>
> Thanks - Daniel
> 


0
Daniel
2/12/2006 3:27:02 AM
Daniel, I too work for a small company with a lean budget and that is
exactly why I went the training route. I have worked with all kinds of
apps over the years and have extensive CRM/SFA experince and I could
have hunted and pecked my way through this application as well and
figured it all out in the end but today my time is worth more than that
so I did spend some of our hard earned profits on training becuase it
was the mst efficient use of my time.

Again, not trying to be a critic just trying to provide some help. In
fact, there is an online course on customization that you would likely
get a lot of your questions anwered as well as getting a better
understanding of why CRM is the way it is in certain ways - like
understanding that the ability to add basic features via script is a
huge benefit vs a detraction from the product, etc. The online course
is less that $900 and you get access to it for 60 days so you can take
you time goig trhough it and jump around in the topics etc.

I'd be happy to point you in the right direction if you are interested.

0
SteveT
2/12/2006 3:59:25 PM
Hi Daniel:

There is a HOL on my blog, http://blogs.msdn.com/jstraumann that covers the 
Client SDK and has a phone number formatting example in it.

I am creating these "labs" as a free resource that you can work through at 
your own pace, feel free to ping me with any questions.

John [MSFT]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script or code samples are subject to the terms
specified at
http://www.microsoft.com/info/cpyright.htm.
"Daniel" <nospam_no@no.com> wrote in message 
news:OOQTKa3LGHA.3408@TK2MSFTNGP12.phx.gbl...
> I really appreciate the way that Outlook auto-normalizes phone numbers - 
> for example, here in the US, I can enter 5555555555 and Outlook 
> automagically formats that to (555) 555-5555.
>
> Why CRM 3.0 doesn't do this out of the box is strange but if anyone has 
> ideas on how to implement, that'd be greatly appreciated.  I've worked 
> very hard to normalize all my data before import, but I know it's a matter 
> of time before our users (ok, our sales people) destroy all that hard work 
> by entering garbage into every phone field entry that the system cannot 
> auto-normalize and error check for them.
>
> Thanks - Daniel
> 


0
John
2/12/2006 6:18:22 PM
Hi John,

Was looking for the same code to format phone numbers.  I know Microsoft 
showed it at the roll-out here in Vancouver and I looked through the 
PowerPoint on your blog but must have missed it. Can you direct me, more 
specifically to the code for formatting phone number?

Thanks

Shauna

"John [MSFT]" wrote:

> Hi Daniel:
> 
> There is a HOL on my blog, http://blogs.msdn.com/jstraumann that covers the 
> Client SDK and has a phone number formatting example in it.
> 
> I am creating these "labs" as a free resource that you can work through at 
> your own pace, feel free to ping me with any questions.
> 
> John [MSFT]
> 
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script or code samples are subject to the terms
> specified at
> http://www.microsoft.com/info/cpyright.htm.
> "Daniel" <nospam_no@no.com> wrote in message 
> news:OOQTKa3LGHA.3408@TK2MSFTNGP12.phx.gbl...
> > I really appreciate the way that Outlook auto-normalizes phone numbers - 
> > for example, here in the US, I can enter 5555555555 and Outlook 
> > automagically formats that to (555) 555-5555.
> >
> > Why CRM 3.0 doesn't do this out of the box is strange but if anyone has 
> > ideas on how to implement, that'd be greatly appreciated.  I've worked 
> > very hard to normalize all my data before import, but I know it's a matter 
> > of time before our users (ok, our sales people) destroy all that hard work 
> > by entering garbage into every phone field entry that the system cannot 
> > auto-normalize and error check for them.
> >
> > Thanks - Daniel
> > 
> 
> 
> 
0
Utf
3/16/2006 7:31:25 PM
Here is some auto-number formatting code I created for a client.  The 
switch..case is not in the best format but the International department is 
unsure how they want to format and enter different international numbers.  
Right now they are prefixing everything with a + and if a + exists then it 
doesn't get formatted.

var oField = event.srcElement;
var newPhone;
var sTmp;

//if (typeof(oField) != "undefined" && oField != null)
if (oField.DataValue != "" && oField.DataValue != null)
{
  sTmp = oField.DataValue;
  if (sTmp.substr(0,1) != "+")
  {
     sTmp = oField.DataValue.replace(/[^0-9]/g,"");
     switch (sTmp.length)
     {
          case 10:
      oField.DataValue = "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) 
+ "-" + sTmp.substr(6, 4);
      break;

    case 7:
      oField.DataValue = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
      break;

    case 12:
       oField.DataValue = "+" + sTmp;
      break;

    case 9:
        oField.DataValue = "+" + sTmp;
    break;

     case 11:
        oField.DataValue = "+" + sTmp;
      break;

      case 13:
          oField.DataValue = "+" + sTmp;
      break;

     case 14:
          oField.DataValue = "+" + sTmp;
      break;

     default:
     var resp;
     resp = window.confirm("The phone number you entered is an invalid 
format.  Would you like to change it now?  If so click Ok.  Pleae enter phone 
numbers without spaces or special characters.");



"Shauna Koppang" wrote:

> Hi John,
> 
> Was looking for the same code to format phone numbers.  I know Microsoft 
> showed it at the roll-out here in Vancouver and I looked through the 
> PowerPoint on your blog but must have missed it. Can you direct me, more 
> specifically to the code for formatting phone number?
> 
> Thanks
> 
> Shauna
> 
> "John [MSFT]" wrote:
> 
> > Hi Daniel:
> > 
> > There is a HOL on my blog, http://blogs.msdn.com/jstraumann that covers the 
> > Client SDK and has a phone number formatting example in it.
> > 
> > I am creating these "labs" as a free resource that you can work through at 
> > your own pace, feel free to ping me with any questions.
> > 
> > John [MSFT]
> > 
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> > Use of any included script or code samples are subject to the terms
> > specified at
> > http://www.microsoft.com/info/cpyright.htm.
> > "Daniel" <nospam_no@no.com> wrote in message 
> > news:OOQTKa3LGHA.3408@TK2MSFTNGP12.phx.gbl...
> > > I really appreciate the way that Outlook auto-normalizes phone numbers - 
> > > for example, here in the US, I can enter 5555555555 and Outlook 
> > > automagically formats that to (555) 555-5555.
> > >
> > > Why CRM 3.0 doesn't do this out of the box is strange but if anyone has 
> > > ideas on how to implement, that'd be greatly appreciated.  I've worked 
> > > very hard to normalize all my data before import, but I know it's a matter 
> > > of time before our users (ok, our sales people) destroy all that hard work 
> > > by entering garbage into every phone field entry that the system cannot 
> > > auto-normalize and error check for them.
> > >
> > > Thanks - Daniel
> > > 
> > 
> > 
> > 
0
Utf
6/19/2006 9:43:01 PM
Thanks Jeremy!  Will try it out.

Shauna

"Jeremy Winchell" wrote:

> Here is some auto-number formatting code I created for a client.  The 
> switch..case is not in the best format but the International department is 
> unsure how they want to format and enter different international numbers.  
> Right now they are prefixing everything with a + and if a + exists then it 
> doesn't get formatted.
> 
> var oField = event.srcElement;
> var newPhone;
> var sTmp;
> 
> //if (typeof(oField) != "undefined" && oField != null)
> if (oField.DataValue != "" && oField.DataValue != null)
> {
>   sTmp = oField.DataValue;
>   if (sTmp.substr(0,1) != "+")
>   {
>      sTmp = oField.DataValue.replace(/[^0-9]/g,"");
>      switch (sTmp.length)
>      {
>           case 10:
>       oField.DataValue = "(" + sTmp.substr(0, 3) + ") " + sTmp.substr(3, 3) 
> + "-" + sTmp.substr(6, 4);
>       break;
> 
>     case 7:
>       oField.DataValue = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
>       break;
> 
>     case 12:
>        oField.DataValue = "+" + sTmp;
>       break;
> 
>     case 9:
>         oField.DataValue = "+" + sTmp;
>     break;
> 
>      case 11:
>         oField.DataValue = "+" + sTmp;
>       break;
> 
>       case 13:
>           oField.DataValue = "+" + sTmp;
>       break;
> 
>      case 14:
>           oField.DataValue = "+" + sTmp;
>       break;
> 
>      default:
>      var resp;
>      resp = window.confirm("The phone number you entered is an invalid 
> format.  Would you like to change it now?  If so click Ok.  Pleae enter phone 
> numbers without spaces or special characters.");
> 
> 
> 
> "Shauna Koppang" wrote:
> 
> > Hi John,
> > 
> > Was looking for the same code to format phone numbers.  I know Microsoft 
> > showed it at the roll-out here in Vancouver and I looked through the 
> > PowerPoint on your blog but must have missed it. Can you direct me, more 
> > specifically to the code for formatting phone number?
> > 
> > Thanks
> > 
> > Shauna
> > 
> > "John [MSFT]" wrote:
> > 
> > > Hi Daniel:
> > > 
> > > There is a HOL on my blog, http://blogs.msdn.com/jstraumann that covers the 
> > > Client SDK and has a phone number formatting example in it.
> > > 
> > > I am creating these "labs" as a free resource that you can work through at 
> > > your own pace, feel free to ping me with any questions.
> > > 
> > > John [MSFT]
> > > 
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > > Use of any included script or code samples are subject to the terms
> > > specified at
> > > http://www.microsoft.com/info/cpyright.htm.
> > > "Daniel" <nospam_no@no.com> wrote in message 
> > > news:OOQTKa3LGHA.3408@TK2MSFTNGP12.phx.gbl...
> > > > I really appreciate the way that Outlook auto-normalizes phone numbers - 
> > > > for example, here in the US, I can enter 5555555555 and Outlook 
> > > > automagically formats that to (555) 555-5555.
> > > >
> > > > Why CRM 3.0 doesn't do this out of the box is strange but if anyone has 
> > > > ideas on how to implement, that'd be greatly appreciated.  I've worked 
> > > > very hard to normalize all my data before import, but I know it's a matter 
> > > > of time before our users (ok, our sales people) destroy all that hard work 
> > > > by entering garbage into every phone field entry that the system cannot 
> > > > auto-normalize and error check for them.
> > > >
> > > > Thanks - Daniel
> > > > 
> > > 
> > > 
> > > 
0
Utf
6/19/2006 9:56:02 PM
Reply:

Similar Artilces: