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.

recalculate auto-calculate field with global storage reference

Featured Replies

I have an auto-calculate field that uses a global field in it's calculation. If I change the global fields (Server Address and Path), I would like to have the autocalc field (photopath) recalculate for all records with the new global field values. What is the best way to accomplish this, a script?

 

The purpose is to have global fields identify the location of the images so that if I have to move the database to a new computer or upload to a server, I can just update those global fields with the new server address and image folder path so all the container fields have the proper reference path.

 

I attached a mock database.

Any suggestions?

 

autocalcfmp12.zip

I'm not sure why you want to set the path to the global field, and not just use the global field itself.  One thing to note about global fields is that they behave differently if the file is hosted by Filemaker Server rather than be hosted with "Network Sharing" directly from a client machine with FM Pro. On server, the globals are specific to each client, so different users can set the global field to their own value and not effect other users. 

 

An approach that you might consider is having a separate table for "preferences".  On this table define a text field called 'path'.  Create only one record on this table and join it to other tables with the "all records" operator (X).  On your Photos table, define 'photopath' as a calculation field which references 'path' on the Preferences table (i.e. do not use an auto-enter text field).

  • Author

Mathew,

 

Thanks for the reply, getting rid of the auto-enter worked fine. Not sure why I was making it so complicated.

  • Author

One problem, when I uploaded my database to the server. I have one table with one record with a field showing the root path to my image files. When I change the GlobalRootPath (path to my images folder), the image path (calculation field = GlobalRootPath & PhotoSerialNo) does not recalculate. I thought calculation fields always recalculate?

One thing to note about global fields is that they behave differently if the file is hosted by Filemaker Server rather than be hosted with "Network Sharing" directly from a client machine with FM Pro.

 

What Matthew said: globals calculate differently when hosted.

 

You need a preferences table to store the file path, not a global field.

  • Author

Any chance I can get a link describing the creation of this reference table? Sounds pretty straight forward but I'm not sure how to "join it to other tables with the "all records" operator (X)". I searched the Forums and Googled it, not much is turning up.

 

Thanks.

Yes, the relationship to a preferences table is very simple. You can create additional occurrences of the prefs table, if necessary, to make direct links to other data tables in your relationship graph. 

 

More tricky, is getting the correct path to your photo collection. Included on this example file is a button (Get Mac Path) that lets you browse to a photo in your repository and then sets the corresponding path in the preferences table. 

 

PathPrefs.fmp12.zip

  • Author

Just what I needed. After all these years, I never really knew about the X (Cartesian) relationship. Thanks for your assistance.

Nice demo Matthew.  :yep:

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.