When to use this endpoint

Use AssetTable_deleteAll when clearing a configured table before it is refilled or removed. CRM screens normally scope the operation to the asset currently open.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
aidInteger stringYesAsset scope. A positive value deletes only that asset’s rows and is checked against the tenant asset table. Exact 0 deletes matching table rows for every asset. Negative values are rejected.
tidInteger stringYesPositive Asset Table definition ID. The handler does not check whether that ID remains in the asset-tables setting.

Example request

$result = FM_api('AssetTable_deleteAll', [
	'aid' => '418',
	'tid' => '1700000000123',
]);

Example response

{
  "ok": 1
}

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.
{"error":"missing or invalid parameter: aid"}aid is absent or integer-converts below zero.
{"error":"missing or invalid parameter: tid"}tid is absent or not positive.
{"error":"asset does not exist"}A positive aid does not identify a tenant asset. Archived and soft-deleted asset rows still satisfy this lookup.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • The response is successful even when no rows match. There is no pagination or per-row result.
  • Table definitions are not changed. Removing a definition is a separate operation.

Side effects

  • Permanently deletes matching asset_tables rows, invalidates that cache, and writes one asset activity-log entry. It does not write deletion-poll rows.

See it in Fieldmotion

CRM1

Open an asset’s Tables tab, choose a table, click Delete All Rows, confirm the phrase, and inspect AssetTable_deleteAll. CRM1 sends the current asset ID.

CRM2

Open an asset’s Tables area and use Clear Table Data. The table-removal dialog also calls this endpoint after removing the definition, but scopes deletion to the currently open asset.

Related endpoints