When to use this endpoint

Despite its name, RequisitionOrderEntry_getLayoutDetails returns data rows, not layout definitions. Use native fields and explicit IDs/roID; use a paged RequisitionOrders collection for table browsing.

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 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

ParameterTypeRequiredDescription
id / idsPositive integer or native/JSON arrayYesid wins over ids. Every member must be a positive integer. An empty list returns []; omitted, malformed, zero or negative selectors fail.
fieldsNative arrayNoMapped names; defaults to all map keys. Empty list still returns id; line normalization additionally returns nominal_id/nominal_code. A JSON string is not decoded.
orderField name or native listNoMapped field names or native objects {id,dir}; dir must be asc or desc. Invalid controls are rejected; omitted order has no guarantee.
Mapped field filtersScalar or native arrayNoMapped raw values or native picker components combine with AND. Text equality trims/lowercases input and lowercases storage. Numeric filtering retains the shared helper’s integer conversion, including decimal fields. Empty/invalid numeric field lists become a false predicate; nested non-scalar filter values fail validation.
advanceSearchNative condition arrayLegacy controlNative list of mapped {id/column,condition,value,andOr} rules. Conditions: equal, notEqual, contains, greaterThan, greaterThanOrEqual, lesserThan, lesserThanOrEqual. andOr is AND or OR. Raw where clauses and malformed controls are rejected.

Example request

$result = FM_api('RequisitionOrderEntry_getLayoutDetails', [
	'roID' => '1042',
	'fields' => [
		'id',
		'stock',
		'qty',
		'costNet',
	],
]);

Example response

[
  {
    "id": "2088",
    "stock": {
      "id": "501",
      "type": "1",
      "text": ""
    },
    "qty": "2",
    "costNet": "12.5",
    "nominal_id": 0,
    "nominal_code": ""
  }
]

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: id/ids"}No explicit selector was supplied.
{"error":"invalid advanced search"}A malformed rule or raw where clause was supplied.
{"error":"permission denied"}Required View access is absent.

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

Behaviour and edge cases

  • Returns an unpaginated array of matching, visible rows. Supply positive scalar/native-array/JSON-array id or ids; id wins. Missing selectors are errors and an empty list selects no rows. No default ordering is guaranteed. Unknown projection names are ignored and id is included; a database read failure can still be represented by an empty result from the shared reader.
  • Nominal metadata is derived only from projected nominal/taxType values. If neither was selected, the added nominal_id/nominal_code can be 0/blank even when the stored line has a code. Request nominalCode or taxType to resolve that identity.
  • Line fields include id, roID, stockType, stockID, stockText, stock, supplierID, qty, costNet, totalNet, totalTax, cDate, lastEdited, nominalCode, nominal_code, taxTypeID/taxType and poeID. totalGross is a client formula, not a calculated response field. stock is {id,type,text}; taxType is {id,nominalID}.
  • Stored JSON text is not uniformly decoded: a selected whole meta/customValues column remains its stored JSON string, while a nested metaLink projection is resolved from decoded metadata. Unknown/derived-only names add no response value.
  • Nominal storage remains the accounting code. Explicit nominal_id/nominalID resolve local Accounts; nominal_code is an explicit code. Legacy nominal/nominalCode and taxType.nominalID resolve a matching code before treating a numeric value as an Account ID. Conflicting explicit ID/code matches return an error. Unknown legacy text can remain a code. Reads add nominal_id (integer) and nominal_code (string), normalize nominalCode to the local ID when selected, and normalize taxType.nominalID to that ID.
  • Every selected line must have a visible, non-deleted parent. Use roID as an additional filter; it does not replace the explicit line ID selection.

Side effects

  • Read only. No inventory, allocation, status or audit mutation.

See it in Fieldmotion

CRM1

No direct caller was found in CRM1 source. Its requisition screen uses the legacy header/line endpoints instead.

CRM2

No endpoint-specific direct caller was found in CRM2. Shared RequisitionOrderEntry_getRequestedDetails/RequisitionOrderEntry_getLayoutDetails helpers can derive this route from table identity. The current requisition spreadsheet loads through Layouts_getDataTable and saves through Layout_setValue; filter for those requests rather than expecting this endpoint on every open.

Related endpoints