Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Audit.Delete
Log record deletion.
Component |
Version |
macOS |
Windows |
Linux |
Server |
iOS SDK |
Audit
|
2.8 |
✅ Yes
|
✅ Yes
|
✅ Yes
|
✅ Yes
|
✅ Yes
|
MBS( "Audit.Delete"; TimeStamp; TableName { ; FieldsToIgnore } )
More
MBS(
"Audit.Delete"; /* Log record deletion. */
$TimeStamp; /* Pass here the timestamp field you added for auditing to the table.e.g. AuditTimeStamp */
$TableName; /* The name of the table.
With 10.2 optionally as second value the name of the audit log table unless you take the default AuditLog.e.g. "Firma¶MyAuditLog" */
$FieldsToIgnore) /* Optional; A list of field names to ignore.
Global fields and those set with
Audit.SetIgnoredFieldNames are always ignored.e.g. "myField" */
Less
Parameters
Parameter |
Description |
Example |
Flags |
TimeStamp |
Pass here the timestamp field you added for auditing to the table. |
AuditTimeStamp |
|
TableName |
The name of the table.
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 |
Result
Returns 1.
Description
Log record deletion.
In order to log record deletion, please go to "Manage Accounts & Privileges" dialog in FileMaker. Check the Privileges Sets tab and create a new custom privilege set. You can duplicate one of the existing ones like the "Data Entry Only" set. Edit the new privilege set and select for Records the custom privileges option in the popup menu. For the custom record privileges, you choose for delete the limited option in the popup menu. Now in the specify calculation dialog, you enter the function: MBS( "Audit.Delete" ). Done for this table. Repeat for other tables and for other privilege sets you need.
The plugin will analyze the record on deletion now and write down values to AuditLog table with Create/Changed entries if the record was not yet analyzed or not completely analyzed so far. Finally for a delete operation, it logs a delete entry.
In the fields to ignore parameters you can pass also "FieldName|Value" to assign special values automatically. As this parameter can be build with a calculation, you can query variables or other tables for information you want to log.
You can call Audit.SetIgnoredFieldNames in order to have the plugin ignore some fields. Or pass the field names to this function.
Be aware that even if you call this function from the calculation in privileges the deletion may be cancelled later and you have deleted logged, but not executed. You can work around by implementing your own dialog for user to cancel.
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.
The audit functions relay on the permissions to make SQL queries on your tables.
Examples
Log record on delete:
MBS( "Audit.Delete"; MyTable::AuditTimeStamp; "MyTable" )
Run delete and set a custom field with a special value:
MBS("Audit.Delete"; Audit::AuditTimeStamp; "MyTable"; "CurrentTaskID|" & $$CurrentTaskID)
See also
Release notes
Blog Entries
FileMaker Magazin
Created 18th August 2014, last changed 12nd May 2021
Audit.ClearCaches
-
Audit.Delete2
Feedback: Report problem or ask question.