When to use this endpoint

Select mapped receipt-list columns for CRM2 tables and export ID discovery.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. Session CSRF, account-active and IP restrictions still apply. These handlers add no receipt-specific page, finance, department or record-owner permission check.

Records are scoped to the authenticated tenant. CRM1 displays Goods Received with employer feature bit 262144; CRM2 checks features2.goodsReceivedNotes. Those screen gates are not enforced by these handlers. Mobile receipt routes run separately through the mobile intermediary and have different permission and ownership checks.

Mapped handlers require both a logged-in user and a tenant context before loading the tenant field map.

Parameters

ParameterTypeRequiredDescription
fieldsNative alias arrayYesUses the GoodReceived header aliases; unknown aliases are ignored and id is appended. Native arrays only; JSON text is not decoded.
isTableIntegerNoDefaults true; 0 returns only {data:[...]} without count/draw fields.
start, length, drawIntegerNoTable mode defaults start=0,length=10,draw=0. start must be nonnegative and length positive when supplied; no maximum page-size cap. draw must be an integer.
limitIntegerNoNon-table mode: nonnegative integer, positive values cap rows and zero means no cap. Negative values are rejected.
orderBy, orderDescAlias / stringNoTable-mode named ordering; supply both. Direction must be asc or desc (case-insensitive, normalized). Alias matching uses the shared mapped fallback.
orderNative DataTables arrayNoAlternative table sort: first column minus one indexes fields; negative index clamps to zero. dir recognizes exact desc, else asc. Defaults to first mapped requested field ascending.
searchValue, searchFieldString / alias or native arrayNoTrimmed lowercase LIKE search. searchField defaults to All. This map stores supplierID and poID, not related display names; those IDs are searched as stored values.
Mapped aliasesScalar/native arrayNoNumeric scalar equality/native IN filters, case-insensitive substring matching for scalar text, exact IN matching for text lists; filters intersect. Native empty numeric lists match none. target has no physical id in this map, so use targetID/targetType rather than relying on composite target filtering.
referenceDateMapped date aliasNoUse cDate or lastEdited to enable relative date/hour filters.
dateFrom, dateToInteger day offsetsTogetherRelative to today in tenant timezone (UTC fallback), inclusive 00:00:00–23:59:59; not ISO date strings as in GoodsReceived_getDT.
offsetFrom, offsetToNative objectsNohour is negated, minute added when adjusting date bounds.
timeRangeFrom, timeRangeToInteger hoursNoRequires timeRangeFrom to activate (a lone timeRangeTo is ignored). Defaults 0–23, reversed values swap; timezone lookup falls back to Europe/London, unlike day filtering.
groupByNative alias arrayNoMapped SQL grouping. No aggregate contract; selecting ungrouped columns can fail on strict SQL modes.
advanceSearchNative rule arrayNoNative structured filter rules using mapped field aliases and allowlisted conditions. Raw where clauses and malformed rule shapes are rejected.

Example request

FM_api('GoodsReceived_getDataTable', ['fields'=>['id','supplierID','cDate','suppInvoice'],'start'=>'0','length'=>'25','draw'=>'1','orderBy'=>'id','orderDesc'=>'desc']);

Example response

{"data":[{"id":"531","supplierID":"84","cDate":"2026-10-09 00:00:00","suppInvoice":"INV-1042"}],"draw":1,"recordsTotal":"1","recordsFiltered":"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: fields"}fields omitted.
{"error":"error in database query"}Selected-row query failed.

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

Behaviour and edge cases

  • Extra main.cDate IS NOT NULL excludes undated headers from data. recordsTotal still counts every header, while recordsFiltered includes the extra filter and other request filters.
  • No receipt-specific owner, department, active/deleted, PO status or approval filtering is applied. Data rows use aliases/composites, not positional CRM1 tuples; no stable ID tie-breaker is enabled.
  • isTable=0 retains the data envelope, omits counts/draw and only orders by referenceDate when supplied. limit=0 can fetch the whole filtered tenant table.
  • Native query shapes, numeric paging controls and sort directions are validated before calling the shared query helper. Raw advanced-search where clauses are rejected.
  • Unlike detail readers, scalar text filters are substring matches and native text arrays use exact IN matching. The target composite is assembled for output, but its missing physical id causes the table filter loop to skip that key.

See it in Fieldmotion

CRM1

CRM1 uses GoodsReceived_getDT; no direct caller for this mapped table was found.

CRM2

Open CRM2 Goods Received and inspect the mapped list requests. Export first calls this endpoint with fields:[id],isTable:0,limit:0 plus current filters to collect receipt IDs.

Related endpoints