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.

Featured Replies

In all of my fm databases, I find that having a logging table is very useful. I've created some scripts that do this :

Log($msg, $severity, $user...) // adds a timestamped log message to the log table with given severity

e.g.

PerformScript("$msg=\"Bad error occurred in XXXX\" ; $severity=\"Error\" ; $user=\"" & Get(CurrentUser)& "\";")

However, the actual script is not very fast or efficient, as it basically does this:

* create a new window showing the log table (or show it if it's already open)

* create a new record in the log table

* fill in the fields

* commit

* close or hide the log window

The reason that I use a separate window for the log table, rather than simply using "go to layout "Log" ; ... ; Go to layout (original layout)" is that I've found that switching layouts can cause some issues (tab panel tab is lost, portals lose their scroll position, etc.) Also, this means I can call the script from anywhere, even if the current table doesn't have a relationship to the log table.

Question: is there a better way? I was wondering if there was some clever way to get the same result without switching windows or layouts?

You could use an SQL plug-in.

Try using a "magic key" method to create related records. This works through a global field and does not require changing layouts.

http://www.filemakerhacks.com/?p=2364

  • Author

Try using a "magic key" method to create related records. This works through a global field and does not require changing layouts.

http://www.filemakerhacks.com/?p=2364

Very cool : reading this, I had some questions.

* Can this be used from any layout? Or does it need to be run from a layout that has the g_magic_key relationship? If so thats a little limiting compared to my scripted version (which has the advantage that it can be called from anywhere).

* Is this multi-user safe? It should be since it uses globals.

* Is this single-user recursive safe? I'm guessing it's not, since the global key value would be the same for a single user. (The scenario I'm imagining is an error that happens in the logging code itself, so that the logging code tries to log an error in the middle of logging a message. Probably not a big problem.)

the logging code tries to log an error in the middle of logging a message

Be carefull when designing this; specifically look out for creating an infinite loop in your script.

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.