Monetize360

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

ParameterTypeDescription
mobjectIdstring (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

FieldTypeDescription
successbooleanWhether the operation was successful
mobjectIdstring (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:

  1. Validates Input: Checks that mobjectId is provided
  2. Checks Audit Status: Verifies that the Object does not have audit enabled
  3. Checks Object Type: Skips TRANSIENT objects (they don't have physical tables)
  4. Performs TRUNCATE: Executes a TRUNCATE TABLE operation on the Object's table
  5. 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:

  1. Disable audit on the Object (if allowed)
  2. Use individual delete operations instead
  3. 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 → End

Important 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

  1. Backup First: Always create a backup before using this function
  2. Verify Object: Double-check the Object ID before execution
  3. Check Audit Status: Verify that audit is disabled if you need to use this function
  4. Use in Workflows: Consider adding validation steps in workflows before deletion
  5. Log Operations: Log the deletion operation for audit purposes
  6. Test Environment: Test the operation in a non-production environment first