Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Audit.Backup

Log record.

Component Version macOS Windows Linux Server iOS SDK
Audit 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Audit.Backup"; timestamp; TableName { ; FieldsToIgnore...; ExtraFields... } )   More

Parameters

Parameter Description Example Flags
timestamp Pass here the timestamp field you added for auditing to the table.
This field is passed here to trigger the calculation, but the value is not used. Must be a timestamp.
AuditTimeStamp
TableName The name of the table.
Or the table occurrence if needed.

With 10.2 optionally as second value the name of the audit log table unless you take the default AuditLog.
"Firma¶MyAuditLog"
FieldsToIgnore... A list of field names to ignore.
Global fields and those set with Audit.SetIgnoredFieldNames are always ignored.
"myField" Optional
ExtraFields... Custom fields to set.
Pass in field name followed by "|" character and a value.
Field type can be text or number.
"ScriptName|" & $ScriptName Optional

Result

Returns OK or error.

Description

Log record.
Same as Audit.Changed, but uses Backup for the action field.
You can call this function before loading a record to make sure all data from the record are logged. Then you are sure to have old values for an undo.

In the fields to ignore parameters you can pass extra values "FieldName|Value" to assign special values automatically to your fields. As this parameter can be build with a calculation, you can query variables or other tables for information you want to log.

This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat FieldsToIgnore and ExtraFields parameters as often as you need.

Examples

Run Backup and set a custom field with a special value:

MBS("Audit.Backup"; Audit::AuditTimeStamp; "MyTable"; "Reason|Backup")

Loop over all records in the current found set:

# loop over all
Set Variable [ $count ; Value: Get(FoundCount) ]
If [ $count > 0 ]
    Go to Record/Request/Page [ First ]
    Loop
        # your script steps here
        Set Variable [ $r ; Value: MBS("Audit.Backup"; Kontakte::TimeStamp; "MyTable") ]
        # next
        Go to Record/Request/Page [ Next ; Exit after last: On ]
    End Loop
End If

See also

Release notes

Blog Entries

This function checks for a license.

Created 27th October 2018, last changed 12nd May 2023


Archive.lzmaVersion - Audit.Backup2

💬 Ask a question or report a problem