Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6608 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I found out recently that you can't make custom scripts with FM Pro 8.5, because I don't have Advanced. So now I am stumped. All I am trying to do is what would seem (and I don't understand why it's not standard) to be easy is make a phone number field that automatically seperates the area code and puts the dash in. I have several scripts, but since I don't have adavanced I can't use them. Somebody please help me.

Posted

I think you are confusing "Custom Functions" which is only available in Advanced. However you can create a :):phonefield (Text Field)and have an autoenter calculation:

Case(Length(Phone) = 7;Left(Phone;3) & "-" & Right(Phone;4); (Length(Phone) = 10); "(" & Left(Phone;3) & ") " & Middle(Phone; 4; 3) & "-" & Right(Phone;4);"error")

"Phone" is the name of your Phone Number field.

This calculation requires you enter the data as numbers only 2127894563 returns 212-789-456. If the user enters the number any other way you will get an error. Also, if the data already exists you will need to re-enter the data to get the proper result unless you check "Do not replace existing data if any." However, you will then have whatever garbage is already in there remain.

HTH

Al

Posted

Here's a formula that will allow your users to enter a phone number with any formatting they want. The formula will remove the formatting and then format it the way you want. You can combine it with the formula from aldipalo to test for 10 or 7 digits numbers. You can download the example file with the link below:

http://www.filemakerpros.com/FieldFilter7.zip

Posted

Hi John Mark:

So I use this custom function:

Case(

Length(Phone Number) = 7;Left(Phone Number;3) & "-" & Right(Phone Number;4);

(Length(Phone Number) = 10); "(" & Left(Phone Number;3) & ") " & Middle(Phone Number; 4; 3) & "-" & Right(Phone Number;4);

(Length(Phone Number) >10) and Left (Phone Number ;3)="011";Left(Phone Number;3) & "-" & Middle(Phone Number; 4; 2) & "-" & Middle(Phone Number; 6; 3)& "-" & Middle(Phone Number; 9; 3) & "-" & Right(Phone Number;4);

"Re-enter in number format")

where do I put the Filter piece?

Al

Posted

Hi aldipalo:

... where do I put the Filter piece?Al

By implementing the Let function. Your Case statement would then reside in the calculation body of the Let statement. If you haven't yet worked with Let statements, check out John Mark's calculations in the attachment above. They're one of my favorite features to come out of FM7.

This topic is 6608 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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