Jobs: forms and resources
Remove a job table row
/a/Job_deleteTableColumn
Remove a selected stored table row, including populated rows, without changing the table schema.
When to use this endpoint
Use for the explicit row-delete action after reading the current table. The legacy name column refers to a stored outer row; a transposed UI can display that row as a column.
Choose Job_deleteEmptyTableColumn if an emptiness guard is required, while accounting for its PHP-falsy-cell rule.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
Job and form IDs refer to the authenticated account. Cross-account writes occur only through the stored outsourcing relationship on the routes that explicitly mirror changes.
The dispatcher also applies account/user and IP restrictions. A CRM session carrying a CSRF token must supply it through X-FMCSRF or _csrf; missing/incorrect tokens can be rejected before this handler runs.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
appointment_id | Integer string | Yes | Positive physical job ID; this legacy name is required. |
table_id | Integer string | Yes | Positive ID of a table present in saved answers. |
column | Integer string | Yes | Required stored row index, converted with intval. Unlike the empty-row route, there is no explicit nonnegative validation; use valid zero-based indexes. |
force | String | No | Legacy flag, true when loosely equal to 1. The handler calculates emptiness but never uses that result to block deletion, so force does not provide protection. |
_nonce | String | No | Optional tenant nonce from the CRM nonce flow. If present, it is checked and consumed before operation-parameter validation; omission bypasses nonce checking. |
Example request
$result = FM_api('Job_deleteTableColumn', [
'appointment_id'=>'1042', 'table_id'=>'302', 'column'=>'0',
]);
Example response
{"ok":1}
Errors and unusual responses
| Response | Condition |
|---|---|
{"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: appointment_id"} | Job ID is nonpositive. |
{"error":"missing or invalid parameter: column"} | column is absent. |
{"error":"missing or invalid parameter: table_id"} | Table ID is nonpositive. |
{"error":"Job does not include data from table 302"} | No requested saved table is found on the active job. |
{"error":"That column does not exist in the appointment table data"} | No corresponding stored row exists. |
{"error":"this form appears to have been submitted already"} | A supplied nonce is not found; the nonce helper terminates the request. |
{"error":"Unable to save job"} | The primary database save failed. Successful-save history and subsequent follow-ups are not run. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Reads and writes active jobs only. Splices one outer table row and reindexes the remainder; it does not remove a field definition or all cells at one field index.
- Populated rows are removed even without force: the computed emptiness result is not enforced.
- A supplied nonce is single-use even when later validation fails. Without a nonce, replay can delete the next row now occupying the same index. There is no pagination or concurrency token.
Side effects
- Updates subform_values, timestamps/edit marker and meetings cache; records job history. Primary-write failure returns an error before history is recorded.
- Does not recalculate costs, rebuild asset links, return stock, delete row images or mirror outsourced table data. The nonce helper also removes expired tenant nonces.
See it in Fieldmotion
CRM1
On a job’s Tables page, click the row’s [x] delete control and confirm. pageJobTables.js obtains a nonce and calls Job_deleteTableColumn with the outer row index in column; the vertical layout uses the same stored-row contract.
CRM2
No direct canonical or legacy route caller was found in CRM2’s source. Do not assume its layout-driven table deletion uses this endpoint.
Related endpoints
Job_deleteEmptyTableColumnremoves a stored row with a PHP-truthy-cell emptiness guard.Job_setTablesreplaces the full saved table collection and refreshes dependencies.Job_updateCostsrefreshes cost/resource snapshots and invokes the price follow-up.