Formatting CRM 4.0 Phone Numbers

Here are a couple of great scripts for formatting phone numbers in CRM 4.0 that were posted as a responses to the East Region Microsoft CRM Blog.

/* This code formats the phone number, allowing up to a 5 digit extension to be displayed on the same line. The following code example shows how to format basic U.S. phone numbers. This method supports 7-digit and 10-digit numbers, for example, (410) 555-1212.*/

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

// Validate the field information.
if (oField.DataValue != "undefined" && oField.DataValue != 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 = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
   break;
case "41055512121".length:
   oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,1);
   break;
case "410555121212".length:
   oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,2);
   break;
case "4105551212123".length:
   oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,3);
   break;
case "41055512121234".length:
   oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,4);
   break;
case "410555121212345".length:
   oField.DataValue = "(" + sTmp.substr(0,3) + ") " + sTmp.substr(3,3) + "-" + sTmp.substr(6,4) + " ext." + sTmp.substr(10,5);
   break;
}
}

—-

/* This code formats the phone number, The following code example shows how to format basic U.S. phone numbers. This method supports 7-digit and 10-digit numbers, for example, (410) 555-1212.*/

// Get the field that fired the event.
var oField = event.srcElement;
// Validate the field information.
if (oField.DataValue != "undefined" && oField.DataValue != 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 = sTmp.substr(0, 3) + "-" + sTmp.substr(3, 4);
     break;
 }
}

Renaming “Marketing List Members” in CRM

Marketing list members are not in the customization section, I believe it is a code generated view that integrates with advanced find on the backend. To update this proceed to the following location in the Marketing List Entity.

Customization > Marketing Lists > Messages > edit the Custom Display String for all messages

SharePoint 2007 Installed on Vista

I need to try this out but this solution from Bamboo Solution allow you to install SharePoint in Windows Vista.

I have been on the market for a well needed SharePoint piece of functionality that will allow me to provide users with cascading filtering of metadata in a list when users are selecting respective metatags. I have found several blogs, code snipets and blogs on this topic.

Here they are:

SharePoint Cascading Drop Down List (With Filter) Field Type | by Sarith Sircar (Blog) & on CodePlex

Removing malfunctioning Windows SharePoint Services solutions

While attempting to install a trial solution for SharePoint I ran into an issue using stsadm where I wasn’t able to remove a solution.

Solution too Dern Busy

A quick google search brought me to an excellent article by Alex Thissen titled “Removing malfunctioning Windows SharePoint Services solutions” details the entire process. I my case withe a new SharePoint installation the WSS Administration service had not started and isn’t started from what I can tell by default.

WSS Admin Service

Installing WiFi on Windows Server 2008

Ever wonder why your Windows Server 2008 installation does not work with Wi-Fi? Check this simple solution out.

WS 2008

Free CRM Auditing Tools

Menoo te Koppele has posted an article on free CRM Auditing, I have not reviewed these tools but they seemed to be priced well.

Display full name in SharePoint designer Workflows

Great way to display the common name in a SharePoint workflow rather than the domain/userid @ HERE.

Dynamics CRM 4.0 Tools

I once kept all of my CRM 4.0 tools on a portable usb drive, however this worked most of the time I do not always have the location of the original tool. Well why not keep them here?

Other tools can be found on CODEPLEX

CrmDiagTool4 for Microsoft CRM 4.0

Microsoft Dynamics CRM 4.0 Documentation Generator