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.

Modifying a custom function used in an audit trail

Featured Replies

I'm putting together my first FM project and I've designed an audit trail based heavily on Nightwing's superlog system (http://tinyurl.com/bcdvqv) and a Filemaker Magazine tutorial (http://tinyurl.com/d2t8nh).

The way my variant on these two techniques works is:

(1) Every time a change is made to a record, the details of that change are added to an "audit_log" field in that record. This is all done via a custom function.

(2) When the record is committed, the DoScript plug in triggers a script which cuts the contents of the "audit_log" field and pastes them into a "log processor" table. A script then parses the audit log so that it is recorded in a table.

This then leaves the "audit_log" field blank so that it can be repopulated the next time a record is changed. This is fine. However, because of how the custom function which populates the "audit_log" field is written, when the "audit_log" field is blank (i.e., whenever the editing of a record begins) the original contents of a field that is edited is not recorded.

The code of the custom function is at http://pastebin.com/f24195095. Line 18 is the offending line. Any ideas how I can change it to solve my problem?

Here's one that I use.

I got this from a Filemaker Book.

The field is a text field with auto-calc, replace existing contents. the name of the field is Record History. This is it's function:

**************

Evaluate (

Quote (

Get ( CurrentTimeStamp ) & " | " &

Get ( AccountName ) & " | " &

Get ( ActiveFieldName ) & " | " &

Get ( ActiveFieldContents ) & " | " &

"¶" & Record History

)

;

[here you put the fields that you want to trigger the script, separated by a semi colon]

)

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.