October 20, 200619 yr 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.
October 20, 200619 yr 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
October 20, 200619 yr 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
October 20, 200619 yr 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
October 21, 200619 yr 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.
Create an account or sign in to comment