Jump to content
Server Maintenance This Week. ×

Applying Custom function to existing data


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

Recommended Posts

I'm having trouble with a custom function that applies formatting to phone numbers. For some reason this custom function is only applied to new data that I put into the phone number fields. If I perform an import of data the formatting is not applied until I either add a digit or remove it and then readd it. Is there any way to apply this formatting automatically across all of my phone numbers?

Link to comment
Share on other sites

Hi James,

Are you sure you are using a Custom Function?

You do not show your Advance in your Profile. A Custom Function should automatically apply the formatting to your field, no matter how the raw data is put into it.

This sounds more like what happens when you are using the Auto Entry by Calculated Value to me.

Lee

Link to comment
Share on other sites

Welp, I never claimed to be an Advanced user and you are correct, I am using the auto enter calculation to accomplish this. I am using a custom function to replace the existing value though. Is this the correct method to do this? Right now I am using the calculated value "PhoneMask ( Clinic Fax Number )" to accomplish this

Edited by Guest
Link to comment
Share on other sites

You're missing the point.

I never claimed to be an [color:blue]Advanced user
,

The Skill Level of Advance, is [color:red]not the same as the Advance Edition of FileMaker, which cost more than the Regular Edition of FileMaker, because it comes with developer tools, one of which is the ability to create and use Custom Functions in your files. This Topic is reserved for the discussion of Custom Functions. Many custom funtions like the PhoneMask (number) Link can be used as a normal calculation like you have done, however, you have to be careful that they are not recursive.

When [color:blue]importing your records, be sure to check the box that says "Perform the Auto Enter" in the import box sub popup.

To change the existing data in the field, you can change the field type to a Calculation. the Calculation Box will have the PhoneMask (number) Calculation in it, so just click Okay, and Return to Browse Mode.

Your data will be updated to the format text.

Then, go back into Define Fields, and change the Field Type back to Text, and then check the Auto Enter, your calculation will already be there.

HTH

Lee

Edited by Guest
Link to comment
Share on other sites

To change the existing data in the field, you can change the field type to a Calculation. the Calculation Box will have the PhoneMask (number) Calculation in it, so just click Okay, and Return to Browse Mode.

Your data will be updated to the format text.

Then, go back into Define Fields, and change the Field Type back to Text, and then check the Auto Enter, your calculation will already be there.

HTH

Lee

Just a little something to add here, this will only work if you enable full indexing when changing the field to be a calculation.

T

Link to comment
Share on other sites

Just a little something to add here, this will only work if you enable full indexing when changing the field to be a calculation.

Hi Tony,

AFAIK, indexing has nothing to do with it working or not.

I believe the confusion comes when the standard field has auto-enter (replace) and references a global or unstored field/calculation. If you change it to a calculation and leave the globals (or other unstored fields/Get() functions etc) within the calculation then the calculation will insist upon being unstored. In that case, you will LOSE YOUR DATA in that field when you switch it back to standard field.

The process suggested by Lee works fine (I've used it for years) if it is applied to standard data (because it is stored). When you change it to a calculation, look in Storage Options and verify that 'Do not store calculation results' is NOT checked. If it is UNSTORED, it means your calculation will not re-set the data in the fields when you change it back. It is always recommended that you back up before applying any mass data change and, in this process, verify that the calculation can be stored (isn't checked as 'unstored').

If you can provide an example where indexing plays a role in this process, I'd love to learn about it; I've been wrong before and I'll be wrong in the future and I could be wrong in the present. :smile2:

Link to comment
Share on other sites

This topic is 5212 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.