Delete All Records
Delete all data from an Object table. Only works for non-audit enabled Objects to prevent audit history loss
Delete All Records
Delete all data from an Object table using a TRUNCATE operation. This function permanently removes all records from the specified Object. This operation cannot be undone.
Technical Name: DeleteAllMDataFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: CRUD Operations
- Function ID:
5f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea8
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
mobjectId | string (UUID) | ID of the Object whose data should be deleted |
[Image placeholder: DeleteAllMData function configuration panel]
Input Example
{
"mobjectId": "123e4567-e89b-12d3-a456-426614174000"
}Output Schema
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the operation was successful |
mobjectId | string (UUID) | ID of the Object that was processed |
Output Example
Success Response
{
"success": true,
"mobjectId": "123e4567-e89b-12d3-a456-426614174000"
}Error Response (Audit Enabled)
{
"error": "Operation not allowed: Cannot truncate data for Object 'Customer' because audit is enabled. Truncating would result in loss of audit history."
}[Image placeholder: DeleteAllMData output visualization]
How It Works
The function performs the following steps:
- Validates Input: Checks that
mobjectIdis provided - Checks Audit Status: Verifies that the Object does not have audit enabled
- Checks Object Type: Skips TRANSIENT objects (they don't have physical tables)
- Performs TRUNCATE: Executes a TRUNCATE TABLE operation on the Object's table
- Returns Result: Returns success status and the processed Object ID
Restrictions
Audit-Enabled Objects
This function will fail if the Object has audit enabled. This restriction prevents loss of audit history. If you need to delete all data from an audit-enabled Object, you must:
- Disable audit on the Object (if allowed)
- Use individual delete operations instead
- Or use a different approach that preserves audit history
TRANSIENT Objects
TRANSIENT Objects are skipped automatically as they don't have physical database tables.
Use Cases
Reset Test Data
Clear all test data from a development Object:
{
"mobjectId": "test-data-mobject-uuid"
}Data Cleanup Workflow
Clean up temporary data in a workflow:
Start → ValidatePermissions → DeleteAllMData → LogCleanup → End[Image placeholder: Workflow example]
Bulk Data Reset
Reset staging data before importing new data:
Start → DeleteAllMData → LoadDataFromS3 → ValidateData → EndImportant Warnings
⚠️ Permanent Deletion: This operation permanently deletes all data and cannot be undone.
⚠️ No Recovery: Once executed, there is no way to recover the deleted data unless you have a backup.
⚠️ Audit Protection: The function automatically prevents deletion if audit is enabled to protect audit history.
⚠️ No Confirmation: The function executes immediately without additional confirmation prompts.
Best Practices
- Backup First: Always create a backup before using this function
- Verify Object: Double-check the Object ID before execution
- Check Audit Status: Verify that audit is disabled if you need to use this function
- Use in Workflows: Consider adding validation steps in workflows before deletion
- Log Operations: Log the deletion operation for audit purposes
- Test Environment: Test the operation in a non-production environment first
Related Functions
- Delete Record - Delete a single record by ID
- Fetch MData - Verify data before deletion
- Insert MData - Add data back after deletion