Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Modifying a custom function used in an audit trail


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

Recommended Posts

Posted

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?

Posted

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]

)

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