Requisition orders
Remove mapped requisition lines
/a/RequisitionOrderEntry_deleteData
Delete matching line rows through the mapped filter contract.
When to use this endpoint
Use id for explicit lines or roID for all lines of one editable parent. Full CRM2 spreadsheet replacement uses Layout_setValue to keep header, lines, totals and allocations atomic.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. API keys use their owner’s tenant; session dispatch applies CSRF checks. Office requisition access requires View and Delete on Requisition Order or Requisition Orders. A visible UI control is not sufficient authorization.
Tenant and TeamAccess/legacy department scope apply to headers and to the parent of each line. Deleted parents hide their lines. Scoped users can see their own unlinked requisitions; the legacy department-only rule retains its target-based visibility. There is no additional Requisition feature-entitlement check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id / roID | Positive integer / ID list | Yes | Use an explicit line ID (or native/JSON ID list). roID alone selects all lines of one visible parent. Additional arbitrary mapped filters are not supported. If both id and roID are supplied, membership is checked. |
Example request
$result = FM_api('RequisitionOrderEntry_deleteData', [
'roID' => '1042',
]);
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: id/roID"} | No supported selection was provided. |
{"error":"requisition entry does not exist"} | An explicit line is missing. |
{"error":"Return allocated stock before changing requisition materials or quantities"} | The deletion would strand allocated material. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Physically removes the selected lines using the existing lifecycle; this change adds no soft-delete columns or migration. Missing explicit IDs are errors; an empty parent selection may be a successful no-op.
- Requires a visible non-deleted editable parent. The deletion, header totals, parent timestamp, initial containers and audit commit together. Allocated quantities cannot be discarded: return allocated material before removing its source line.
- Mapped deletion retains the existing requisition_order_entr deletion-audit key. Legacy deletion records a requisition history entry. Existing approval is retained; no physical inventory is moved.
Side effects
- Deletes lines and atomically recalculates parent line-only total_net/total_tax, timestamps and remaining initial containers. Records history and invalidates line/header caches.
See it in Fieldmotion
CRM1
No direct caller was found in CRM1 source. Its requisition screen uses the legacy header/line endpoints instead.
CRM2
Edit the Requisition Order line spreadsheet in CRM2 and Save. Layout_setValue replaces its line set through mapped RequisitionOrderEntry_deleteData/RequisitionOrderEntry_createData calls after saving the header. Filter Network for Layout_setValue and the requisitionOrderEntry spreadsheet; this internal endpoint need not appear as a separate browser request.
Related endpoints
RequisitionOrderEntry_createData— Create replacement spreadsheet rows.RequisitionOrderEntry_getRequestedDetails— Review the exact selection first.