doo.functions.audit
The doo.functions.audit.delete function deletes audit records older than a specified datetime in a Tabidoo application. You can optionally limit the deletion to specific tables.
Parameters
applicationId (required)
Type: string
The ID of the application from which the audit records will be deleted.
olderThan (optional)
Type: date (ISO 8601 datetime format)
Deletes records older than the specified datetime. If omitted, no time constraint is applied.
tableIdList (required)
Type: array of strings
An array of table IDs to limit the deletion to specific tables.
Example Usage
Delete audit records older than a specific date for selected tables
await doo.functions.audit.delete({
applicationId: '123456789',
olderThan: new Date()
tableIdList: ['987654321', '192837465']
});
Note: For applicationId (appId) and tableIdList, always use the internal IDs of the objects. Do not use nicenames or display names of apps/tables.
(e.g., applicationId: "64f...", tableIdList: ["efbl-123","prf-456"], not "CRM" or "Orders".)
Use Cases
- Regular cleanup of audit records to optimize database performance.
- Removing old logs for compliance with data retention policies.
- Limiting audit record deletion to specific tables to maintain necessary logs in other areas.
- Ensuring only outdated audit records are deleted while keeping recent ones for tracking changes.