March 11, 200421 yr I thought I read that FMP7 was going to provide field formats for such common uses as Phone Numbers, Social Security Numbers, etc.. I've search through my demo version and can't seem to find this. Any ideas? BTW - I love the ability to relate files more than one relationship away, the new live security, the visual realtionship chart and the conditions you can put on realtionships. But - now that I'm getting cooking - I have to wait for Server to actually use these in the settings I work. Version: v7.x Platform: Windows XP
March 11, 200421 yr The help shows this when looking at the Filter calculation: ------------------- The following example removes all text from the provided data, then formats the remaining numbers in the preferred phone number formatting: Let(phone = filter(theField;"0123456789");"(" & left(phone;3) & ")" & middle(phone;4;3) & "-" & middle(phone;7;4)) If theField contains Work: 408.555.1212 this calculation returns (408)555-1212. ------------------- As far as I can see, a second calculation field is still needed to format phone numbers. Anybody with a manual or example?
March 11, 200421 yr Sam - Actually an extra calculation field is not required any more. Place your calculation above in the auto enter calculation for the field in question and uncheck the "Do not replace existing field value (if any)" Now, when you enter your phone number 4085551212 it will return (408)555-1212 If you enter any value with text or additional characters (as the example you provided), the filter removes everything but the numbers and recreates.
March 11, 200421 yr Additionally I expect that developers will be providing many Custom Functions that can be used for fomatting and many other purposes as well. Steven
March 11, 200421 yr A common misunderstanding. DE is required to create Custom Functions, but not to use them. All FSA Associate Members receive the DE as aprt of their annual membership dues, as well as all updates to it. Steven
March 11, 200421 yr Sorry Steven, seems misunderstanding arises. You said "Additionally I expect that developers will be providing many Custom Functions that can be used for fomatting and many other purposes as well." I was just trying to clarify that the "Developer" would require FileMaker Developer to create these custom functions. I apologise for not stating that it is required for the creation of but not for the use of in a database. Once written then they can be used by any FileMaker 7 client too.
March 11, 200421 yr I was looking for the same thing. The term I was looking for was 'Field Masking'. I found somthing that was in the FM Businesstracker solution. Here is the following calc that happens in the phone number field after a string is entered and get formatted to '(xxx) xxx-xxxx': Case(Type = "Email" or PatternCount(Number; "@"); Number; FormatPhone ( Number; Format NUMBER::Format & " "; "#" )) FUNCTION: FormatPhone ( PhoneNumber; PhoneFormat; Wildcard ) Is a custom function, how it got there i am not sure, and how to get it into my own solution I am not sure.
March 11, 200421 yr This is not so much about the Custom Functions, as a new way to implement any custom formatting calculation. Look for the Phone Formatter on the Tips & Downloads page at http://www.datatude.net There is now an option to re-enter an auto-entered calculation whenever any of the fields involved is modified. This eliminates the need for the "serial ID if mod" field and self-relationship that have been used for this before. I imagine the technique will also simplify the Mod Tracker methods.
March 11, 200421 yr Rivet - The custom function is a tool available to FileMaker Developer 7. It allows the developer to create their own functions to be used in calculations. It can be created once and referenced many times, by any table in that file. As Fenton suggests look to the datatude site for info on recreating. One thing to note though is the use of the new Filter function. As per the FM7 help file Let(phone = filter(theField;"0123456789");"(" & left(phone;3) & ")" & middle(phone;4;3) & "-" & middle(phone;7;4)) If theField contains Work: 408.555.1212 this calculation returns (408)555-1212. So, by using the filter you can specify which characters to look for and it will ignore anything else entered by the user and reformat to the desired result. This is fantastic as the user will not get the Invalid entry result. Combine this with the datatudes example to recreate something similar to the Business Tracker. Just imagine, all those darned display calculation fields leaving your database.
March 11, 200421 yr No apology needed at all. A number of us are spread out here across cyberspace trying to help provide good information. There is a whole lot to cover as we are finding out. Everyone keep digging. There are lots of diamonds in this field. Steven
April 14, 200421 yr Newbies I used the calculation Let(phone = filter(theField;"0123456789");"(" & left(phone;3) & ")" & middle(phone;4;3) & "-" & middle(phone;7;4)) The number formatted correctly as long as I used a 10 digit number ex. 801-555-1212 However when I try to enter only a 7 digit number it ends up displaying like this (555)121-2, is there any way to have the numbers load from the right side so if I do not put in all 10 numbers it formats correctly?
April 16, 200421 yr If you have a default area code , say (123) then you can pad the phone number with the area code and then take the right 10 items as such right ("123"&thephonefield,10) for example: Let(phone = filter(right(defaultAreaCode & theField,10);"0123456789");"(" & left(phone;3) & ")" & middle(phone;4;3) & "-" & middle(phone;7;4))
Create an account or sign in to comment