Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hello

I'm using FMSP 4.5 on Mac OSX FMP Adv 14.0

I want to get rid of phone formatting, too many countries too many formats and it is inserting x everywhere.

What I've done :

1- went to Custom Functions and placed a remar on every line of the function fnPhone(text) and IT DID NOT WORK!
Why?

What is the correct procedure to just leave the phone as typed with no special formatting?

I can find every single phone field and remove the function from there but replacing the function would keep the nice work for a rainy day...

 

Cheers

 

Beto Boton

 

// fnPhone(text)
// depending on phone # length, will format accordingly
// Timothy Trimble, www.timothytrimble.info


//  REMOVED FORMATTTIN FROM PHONE FIELDS

// Let (pnum = Substitute( text; [ " "; "" ]; [ "("; ""]; [ ")"; ""]; [ "-"; ""]; [ "."; ""]; [ "x"; ""] ) ;
// Case (Length(pnum) = 7 ; Left(pnum;3) & "-" & Right(pnum;4) ;
//    Length(pnum) = 10 ; "(" & Left(pnum;3) & ")" & Middle(pnum; 4;3) & "-" & Right(pnum;4) ;
//    (Length(pnum) = 11 and Left(pnum;1) = "1") ; "1+(" & Middle(pnum;2;3) & ")" & Middle(pnum;5;3) & "-" & Right(pnum;4) ;
//    (Length(pnum) > 11 and Left(pnum;1) = "1") ; "1+(" & Middle(pnum;2;3) & ")" & Middle(pnum;5;3) & "-" & Middle(pnum;8;4) & " x" & Right(pnum;(Length(pnum)-11)) ;
//    Length(pnum) > 10; "(" & Left(pnum;3) & ")" & Middle(pnum;4;3) & "-" & Middle(pnum;7;4) & " x" & Right(pnum;(Length(pnum)-10)) ;
//   pnum ) 
// )

  • Author

OK I'll leave the question here so some other "novice" like me can find the answer searching for Phone formatting

The answer is that a custom function has written the LEFT side of the equation 
fnPhone (text) = 

this is located on top of where you write the code ! 

The solution was to just write text and the result would be:

fnPhone (text) = text

Like this:

//This is a CUSTOM FUNCTION -> Manage -> Custom function -> fnPhone(text)
// fnPhone(text)
// depending on phone # length, will format accordingly
// Timothy Trimble, www.timothytrimble.info


//  REMOVED FORMATTTING FROM PHONE FIELDS

// Let (pnum = Substitute( text; [ " "; "" ]; [ "("; ""]; [ ")"; ""]; [ "-"; ""]; [ "."; ""]; [ "x"; ""] ) ;
// Case (Length(pnum) = 7 ; Left(pnum;3) & "-" & Right(pnum;4) ;
//    Length(pnum) = 10 ; "(" & Left(pnum;3) & ")" & Middle(pnum; 4;3) & "-" & Right(pnum;4) ;
//    (Length(pnum) = 11 and Left(pnum;1) = "1") ; "1+(" & Middle(pnum;2;3) & ")" & Middle(pnum;5;3) & "-" & Right(pnum;4) ;
//    (Length(pnum) > 11 and Left(pnum;1) = "1") ; "1+(" & Middle(pnum;2;3) & ")" & Middle(pnum;5;3) & "-" & Middle(pnum;8;4) & " x" & Right(pnum;(Length(pnum)-11)) ;
//    Length(pnum) > 10; "(" & Left(pnum;3) & ")" & Middle(pnum;4;3) & "-" & Middle(pnum;7;4) & " x" & Right(pnum;(Length(pnum)-10)) ;
//   pnum ) 
// )


text

========

wow, what a learning curve...

 

Beto Boton

Australia

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.