February 25, 200916 yr 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?
February 25, 200916 yr 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