Requisition orders
Query the mapped requisition table
/a/RequisitionOrders_getDataTable
Page mapped requisition fields with shared date, picker and text filters.
When to use this endpoint
Use the CRM2 Requisition Orders table or its unpaged export ID-selection pass. For explicit selected-ID export rows use RequisitionOrders_getExportData.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Session requests use dispatcher CSRF protection when configured. API keys use their owner’s identity.
The dispatcher requires explicit View on Requisition Order or Requisition Orders, even without a TeamAccess policy. API keys retain their owner’s permissions. Records are filtered to active headers within RequisitionOrder_scopeSQL: configured TeamAccess, or the legacy department boundary, including the owner exception for unlinked requisitions in the TeamAccess policy.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fields | Native array of mapped names | Yes | Native list, not a JSON-encoded string. id is always selected; unknown names and client-only calculations are omitted. Picker objects are rebuilt from backing fields; backing fields not explicitly requested can be removed from each response row. |
start / length / draw | Integer-compatible strings | No | Table mode defaults start=0, length=10, draw=0. start is a row offset; draw is echoed as integer. Negative or malformed paging values are rejected; no maximum page size is imposed. |
isTable / limit | Integer-compatible flags | No | Default table mode. isTable=0 removes table paging/counts; only a positive limit then caps rows, while limit=0 means unlimited. start/length do not limit unpaged exports. |
orderBy / orderDesc | Mapped field / direction | No | Provide both for named sorting in table mode; use asc or desc. Without them, order[0].column selects a field position after subtracting 1 (clamped at 0); exact order[0].dir=desc descends. No ID tie-breaker is added. |
searchValue / searchField | Text / native field list or name | No | Nonblank searchValue searches mapped fields and configured related display names. Default searchField is All. SQL LIKE wildcards retain their meaning. |
Mapped field filters | Scalars, native arrays or pickers | No | Filters combine with AND. Text scalars use case-insensitive substring matching unless the map declares exact matching; lists use IN. Numeric scalars integer-convert, including decimal fields; list values follow numeric type conversion. Pickers match their ID/type components. |
referenceDate / dateFrom / dateTo | Mapped date field / relative day offsets | No | A valid referenceDate activates date filtering when both day offsets are supplied. Ranges include start-day midnight through end-day 23:59:59; the account timezone chooses today (fallback UTC). Unpaged results sort by the reference field ascending. |
offsetFrom / offsetTo | Native {hour,minute} objects | No | Additional date-time boundary offsets: hour is negated, minute is added. Not applied to date-only fields. These are legacy client controls, not general timezone identifiers. |
timeRangeFrom / timeRangeTo | Integer hours | No | With a valid referenceDate, timeRangeFrom activates an inclusive hour filter; omitted upper hour defaults 23 and reversed bounds swap. timeRangeTo alone does not activate it. Hour conversion uses the account timezone, fallback Europe/London. |
groupBy / advanceSearch | Native arrays | Legacy controls | Mapped grouping and advanced-search rules feed the shared SQL helper. Grouping does not make the count queries grouped counts. Use structured mapped conditions; do not submit raw SQL controls. |
id / ids | Positive scalar/native/JSON selection | Legacy control | Positive scalar, native array or JSON array selection narrows rows by local ID. An explicitly empty array selects no rows; malformed IDs are rejected. |
Example request
$result = FM_api('RequisitionOrders_getDataTable', [
'fields'=>['id','description','status','grandTotalNet','deliveryNet'],
'start'=>'0','length'=>'10','draw'=>'1',
'orderBy'=>'id','orderDesc'=>'asc',
]);
Example response
{
"data": [
{
"id": "312",
"description": "Materials",
"status": "0",
"grandTotalNet": "25.00",
"deliveryNet": "10.00"
}
],
"draw": 1,
"recordsTotal": "12",
"recordsFiltered": "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": "permission denied"} | View is denied. |
{"error": "missing or invalid parameter: fields"} | No native fields list was supplied. |
{"error": "invalid advanced search"} | The checked rule contains raw SQL or unsupported/malformed fields/operators. |
{"error": "error in database query"} | The shared SELECT fails. |
{"error":"permission denied"} | The required page permission is missing. Hidden/deleted records are omitted from collections; explicit parent readers reject an inaccessible parent. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Applies active header scope to both the data query and recordsTotal. recordsFiltered additionally applies requested mapped/date/search predicates. Unpaged isTable=0 returns {data:[...]} without draw/counts; a positive limit caps it.
- Fields include id, user/userID, description, target/targetType/targetID, status, cDate/deliveryDate/lastEdited, dateApproved/approvedBy, delivery/contact/instructions, grandTotalNet/grandTotalTax, deliveryNet/deliveryTax/tax-code picker, poIDs, notes, meta paths and customValues.
- grandTotalNet/grandTotalTax are stored line aggregates; carriage is separate. Client-only grandTotalGross/deliveryGross formulas are not evaluated by this API. poIDs remains stored text, potentially a JSON-array string.
- The Requisition helper validates native fields/order, mapped filter values and advanced-search expressions, rejecting raw where SQL. Typed picker filters must use the helper’s supported native object shape; malformed descriptors fail before querying.
- Positive id/ids selectors narrow rows and empty lists select none. Named sort direction, pagination, grouping and relative date/time controls are validated before querying. No stable ID sort is added; grouped counts still count records.
- Native field, grouping, sort and structured advanced-search controls are checked; raw where expressions and malformed values are rejected before SQL. Pagination values are nonnegative integers; no maximum size is imposed.
Side effects
- Reads tenant data without modifying orders, lines, stock, approval, history or notifications.
See it in Fieldmotion
CRM1
No direct CRM1 literal caller was found in the searched client source. Its positional table is RequisitionOrders_getDT.
CRM2
In CRM2 Requisition Orders, load/filter the table and inspect RequisitionOrders_getDataTable. Configurable export gathers IDs with fields=[id],isTable=0 before requesting f-position rows.
Related endpoints
RequisitionOrders_getExportData— Read selected configurable export rows.RequisitionOrder_get— Read one checked requisition.