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.

Layout Triggers, FM10

Featured Replies

I've been a dormant FM developer, and am just having occasion to examine the Layout Script Triggers in FM10, and I am a little confused (this is a normal state for me). First off, I do not understand why there is a trigger for Layout Load, but not one for Layout Close? Next, I am not sure when the OnRecordCommit trigger actually runs.

Here is the situation: a client wants to process credit card transactions, and a fellow developer has a technique that allows all sensitive information to be pushed up to the card processor (so my app doesn't have to have the security headache!). However, I will still need to offer a layout in which the user enters the card information to be sent up the river.

I have created a layout that uses global fields to gather the input from the user, but I want to be sure that the information in the global fields is cleared out ***no matter what*** when the client leaves the layout or completes the procedure. If the user clicks my "Register" or "Cancel" buttons, I see no problem--I just script the clearing.

But what if they don't? My first thought was, well, run a script to reinitialize the globals when the layout is closed, but... there isn't an OnLayoutClose trigger.

Next I thought, well, what about using the OnRecordCommit trigger, and I began to experiment with a simple "Hello, world" kind of script attached to this event. My understanding of Filemakerdom is that a record gets committed when the user attempts to move to the next record, or clicks outside the entry fields on the layout, but when I try this with my test script, nothing happens.

So, I throw myself on the mercy of the FMForums court of opinion: how might I proceed with this sensitive and critical process?

TIA,

David

Hey David, long time...

1. OnLayoutExit script trigger was added in version 11.

2. OnRecordCommit trigger runs when a record is committed. However, modifying a global field does NOT modify any specific record - so there's no record to commit.

Perhaps it would be better to use a Users table for this.

  • Author

Comment--

Thanks for the reply. I'm glad I'm not crazy that I can't find OnLayoutClose.

Your explanation about the global fields makes sense (in an odd Filemaker kind of way...). Do you think I could use a regular record, and then use the OnRecordCommit trigger to clear out or even delete the record? I will try that out, although it seems weird to save a record, only to immediately erase it...

David

I am not sure I understand ALL the considerations here. Offhand, I'd say this is a case where a custom dialog seems to be the best solution. I also wonder why a user is allowed to leave the layout in a non-scripted way.

In any case, if you do use "regular" records, you only need to clear the CC field - so you can have a permanent record for each user. You could (and probably should) validate the field to be empty.

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.