Audit.Backup2
-------------

Log record.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Audit](component_Audit.md) | [8.5](newinversion85.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Audit.Backup2"; TimeStamp; TableName; FieldsToCheck... { ; ExtraFields... } ) 

**MBS**( **"Audit.Backup2";** /\* Log record. \*/  
**$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.e.g. 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.e.g. "Firma¶MyAuditLog" \*/   
**$FieldsToCheck...**; /\* A list of field names to check.e.g. "myField" \*/   
**$ExtraFields...**) /\* Optional; Custom fields to set.  
Pass in field name followed by "|" character and a value.  
Field type can be text or number.e.g. "ScriptName|" &amp; $ScriptName \*/ 

### 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" |  |
| FieldsToCheck... | A list of field names to check. | "myField" |  |
| ExtraFields... | Custom fields to set.   Pass in field name followed by "\|" character and a value.   Field type can be text or number. | "ScriptName\|" &amp; $ScriptName | Optional |

### Result

Returns OK or error.

### Description

Log record.  
Same as [Audit.Changed2](AuditChanged2.md), 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.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat FieldsToCheck and ExtraFields parameters as often as you need.  
### See also

- [Audit.Backup](AuditBackup.md)
- [Audit.Changed](AuditChanged.md)
- [Audit.Changed2](AuditChanged2.md)

### Release notes

- **Version 10.4**
    - Fixed a crash in [Audit](https://www.mbsplugins.eu/component_Audit.shtml) functions when querying GetFieldID internally. Affects [Audit.Backup](https://www.mbsplugins.eu/AuditBackup.shtml), [Audit.Backup2](https://www.mbsplugins.eu/AuditBackup2.shtml), [Audit.Changed](https://www.mbsplugins.eu/AuditChanged.shtml), [Audit.Changed2](https://www.mbsplugins.eu/AuditChanged2.shtml), [Audit.Delete](https://www.mbsplugins.eu/AuditDelete.shtml) and [Audit.Delete2](https://www.mbsplugins.eu/AuditDelete2.shtml) functions.
- **Version 8.5**
    - Added [Audit.Backup](http://www.mbsplugins.eu/AuditBackup.shtml) and [Audit.Backup2](http://www.mbsplugins.eu/AuditBackup2.shtml) to add data to audit log without editing.

### Blog Entries

- [MBS FileMaker Plugin, version 10.4pr1](https://www.mbsplugins.de/archive/2020-07-28/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[Audit.Backup](AuditBackup.md) - [Audit.BaseTableNameForID](AuditBaseTableNameForID.md)

[HTML Version](AuditBackup2.shtml)