Audit Logging in FileMaker
BeginnerBuild a record of who changed what and when -- FileMaker does not log by default, so you must build it.
What you'll learn
- Two audit logging approaches and their trade-offs
- Implementing a field-change log with OnRecordCommit
- Logging logins and logouts with file triggers
- Performance considerations for high-volume logging
FileMaker does not have a built-in audit log. If you need to know who changed a field value and when, you must build that capability yourself. There are two main approaches: field-history logging (what changed in each field) and event-level logging (which scripts ran, which records were touched). Both use a combination of OnRecordCommit triggers and helper tables.
Approach 1: Event-level logging
Log every record commit with: AccountName, Timestamp, Table, RecordID, and a description of the operation (Created/Modified/Deleted). This is lightweight and tells you who touched which record when. It does not tell you what field changed from what value to what value.
// OnRecordCommit trigger script Set Variable [ $table ; Value: Get ( LayoutTableName ) ] Set Variable [ $recId ; Value: Get ( RecordID ) ] Set Variable [ $event ; Value: If ( Get ( RecordOpenState ) = 2 ; "Created" ; "Modified" ) ] Go to Layout [ "Audit_Log" ] New Record/Request Set Field [ AuditLog::AccountName ; Get ( AccountName ) ] Set Field [ AuditLog::EventAt ; Get ( CurrentTimestamp ) ] Set Field [ AuditLog::TableName ; $table ] Set Field [ AuditLog::RecordID ; $recId ] Set Field [ AuditLog::EventType ; $event ] Commit Records/Requests Go to Layout [ original layout ]
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo