As we saw in this detailed review of what’s new in FileMaker 2023, one of the two flagship features, along with Perform Script on Server With Callback, is what Claris calls “Audit Log.”
There is so much to know about this feature that we preferred to dedicate a full post to it.
This is a very informative article – thank you!
Can you clarify something?
You say “In the case of drag and drop, this goes even further as you can actually modify a record while it is open by another user!”
However, I had not heard that before, and when I tested this, it did not seem to be true. If a record was open (either by editing or just with the Open Record/Request script step), and I tried to drag text into a field on a different FileMaker session, I got the normal dialog saying that another user was editing the record, and my drag-and-drop did not modify the record.
Is there a more specific scenario where drag-and-drop can modify a record that is open by another user/session?
Hi,
Thank you for your comment!
Indeed I cannot reproduce it. I’m pretty sure though that there was a way to modify a record like this. Maybe this has been fixed along the way without notice. Thank you for pointing out! I will update the article now accordingly.
Perhaps you are remembering the issue where drag-and-drop into checkboxes, radio buttons, and popup menus could insert data that was not in the attached value list?
That was definitely something many developers needed to be aware of. Pasting also accomplished the same thing, but drag-and-drop was something a user might even do accidentally. The solution for that scenario was to validate the field at the schema level in Manage Database options for the field, since both drag-and-drop and pasting still can get past layout-object-level “restrictions” like checkbox value lists.
That is still the case. You can still drag any value onto a popup menu.
Hi, thank you for article, very useful!
Is there any way to save the name of a script that changes the record(s)? If I use a normal get (scriptname) I get the audit-script itself, of course.
And – even if I don’t want any spoiler – what is the approach you have used to save the previous record’s content, so the revert is possibile?
Thanks!
Hi Stella,
The way to do this is have a field in each table with an auto-entered calculation (re-evaluating), with.
Let ( _trigger = GetField ("") ; // this to ensure the calculation is triggered if any field is modified
Get ( ScriptName )
)
“if the user himself can perform an import, a deletion of the found set, or a field contents replacement, we recommend to use the custom menus to replace these commands, with associated scripts such as:
Open transaction
Import records
Commit transaction
”
I have tried this with Replace Field Contents, which is an operation that certain admin users will use frequently in our database.
Open transaction
Replace Field Contents [ with Dialog: On]
Commit transaction
However, when I assign the custom menu to use this script, the script doesn’t appear to actually do anything except exit the field in which you are trying to run the replace. Stepping through the script debugger, it appears the Open Transaction step takes you out of the field, which then gives no context on which the Replace can operate.
Pretty frustating! Any way around this?
Yes indeed, now (I think it was in 20.2), Open transaction commits the record, which is a pain.
If the field is in your tab order, you can do:
If [ not IsEmpty ( Get ( ActiveFieldName ))]
Set Variable [ $field ; Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) & "[" & Get ( ActiveRepetitionNumber ) & "]" )
Set Variable [ $pr ; Get ( ActivePortalRowNumber )]
and then loop with Go to next field until Get ( ActiveFieldTableName ) & “::” & Get ( ActiveFieldName ) & “[” & Get ( ActiveRepetitionNumber ) & “]” matches $field. Then if $pr, go to portal row.