02 Desember 2011 0:31
I have used the Jscript below to format phone numbers and it works fine unless you try to add an extension number eg 555-555-5555 ext 678. Does anyone have Jscript which allows you to also have extension numbers?
Thanks in advance
if (typeof (oField) != "undefined" && oField != null)
sTmp = oField.replace(/[^0-9]/g, ""
"(" + sTmp.substr(0, 3) + ")" + sTmp.substr(3, 3) + "-"
"Phone must contain 10 numbers."
+ sTmp.substr(6, 4);
sTmp = oField;
var oField = context.getEventSource().getValue();
02 Desember 2011 5:30
One method is to test if the phone number contains "ext" (oField.indexOf("ext") > 0), if it does, then strip out the all characters begining at e (sTmp = oField.substring(0, oField.indexOf("ext"))) the do your phone number check in sTmp
Hope this helps.
Eric UNG [Senior Analyst Programmer :: Sydney, Australia]
- Disarankan sebagai Jawaban oleh Philippe LEAL 07 Desember 2011 9:15
14 Juni 2012 18:20
I realize this is an old post, however we are having problems with CRM 2011 importing Outlook 2010 -- The issue we are trying to resolve:
Importing pre-formatted contacts from Outlook 2010 and/or entering American
telephone numbers with a business extensions, ie: (444) 555-6666 x7777777 ...
perfect example: Microsoft employees have American 10-digit numbers with 7-digit extensions.
More specifically, (444) 555-6666 x7777777 with a single space between the 10-digit number and 'x', no space between 'x' and 7-digit extension.
Sorry I am not an experienced java-script-code professional, but I can certainly cut/paste and follow processes from YouTube tutorials -- Does anyone have any suggestions?
Thank you in advance,