Standardize The Display Of Phone Numbers

This Content Component encountered an error
Add this tip to a validation field for a phone number or fax number. It will
standardize the display of the phone number.
@If(Phone="";@Return("");"");
tPhone0 := @ReplaceSubstring (Phone; "("; "");
tPhone2 := @ReplaceSubstring (tPhone0; ")"; "");
tPhone3 := @ReplaceSubstring (tPhone2; "-"; "");
tPhone4 := @ReplaceSubstring (tPhone3; "/"; "");
tPhone5 := @ReplaceSubstring (tPhone4; " "; "");
tPhone6 := @ReplaceSubstring (tPhone5; "_"; "");
tPhone7 := @ReplaceSubstring (tPhone6; "="; "");
tLengthPhone := @Length (tPhone7);
tPhone8:= @If(tLengthPhone > 10 ; @Right (tPhone7; 10); tPhone7);
tNoFrillPhone := @Trim(tPhone8);
REM "Set default area code if none entered to 714";
tArea := @If(tLengthPhone = 7;"714";@Left(tNoFrillPhone;3));
tOther := @If(tLengthPhone = 7;tNoFrillPhone;@Right(tNoFrillPhone; tArea));
tPre := @Left(tOther; 3);
tSuffix := @Right(tOther;4);
tPhoneLen := (tLengthPhone -10);
tDialPre := @If(tLengthPhone > 10; @Left(tPhone7;tPhoneLen); "");
@If(tLengthPhone>10; Phone; tDialPre + "(" + tArea + ") " + tPre + "-" +
tSuffix)
This was first published in November 2000

Dig deeper on Lotus Notes Domino Formula Language

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close