Jump to content

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

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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.

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