Goods Received
Set the supplier delivery-note reference
/a/GoodsReceivedNote_setSupplierDeliveryNoteNo
Replace the receipt supplier delivery-note reference from CRM1.
When to use this endpoint
Replace the receipt supplier delivery-note reference from CRM1.
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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer | Yes | Receipt header ID; must integer-coerce to at least 1. |
val | String | Yes | Whole replacement value; blank clears the column. Omitted/null is rejected; no append, uniqueness or supplier check. |
Example request
FM_api('GoodsReceivedNote_setSupplierDeliveryNoteNo', ['id'=>'531', 'val'=>'DEL-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 id"} | id omitted/invalid/below 1. |
{"error":"no supplier delivery note number supplied"} | val omitted/null. |
{"error":"goods received note does not exist"} | Header lookup returned no row (including read failure). |
{"error":"goods receipt write failed"} | Checked update/history persistence failed; transaction rolls back. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Locks the target receipt and compares the raw replacement text with the stored value. An unchanged quoted/backslash-containing value is a no-op and returns {"ok":1,"warning":"no change needed"}.
- Changed text, server last_edited and field history commit atomically. A failed read/write/history/commit returns an error and rolls back; the receipt cache is invalidated.
- Blank text clears the column. There is no append/merge, uniqueness or supplier validation. No stock, receipt-line or PO status change, and no mention-notification helper.
Side effects
- Checked receipt text/edit-timestamp/history write with receipt cache invalidation. A no-op does not change the timestamp or add history.
See it in Fieldmotion
CRM1
In Goods Received click the Delivery Note # cell and save its editor. Filter developer tools for GoodsReceivedNote_setSupplierDeliveryNoteNo; the UI submits id and val.
CRM2
No direct CRM2 caller was found. CRM2 edits suppDNN through GoodReceived_updateData / Layout_setValue.
Related endpoints
GoodReceived_updateData— mapped multi-field edit/history.GoodReceived_getRequestedDetails— read back stored header values.