When to use this endpoint

Build a suggested reference from the account’s configured last-reference lookup without reserving it.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session. These calls use the authenticated account’s data; the handler has no additional job-page, department, assignee or client-admin permission check unless stated below.

Parameters

This endpoint has no operation-specific parameters.

Example request

$next = FM_api('Jobs_getJobRefNext');

Example response

"JOB-0043"

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.

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

Behaviour and edge cases

  • Checks DBP, then returns an empty string immediately when job-ref-method=2 disables automatic references. For other methods, delegates to Jobs_getJobRefLast; false/blank last references become an empty base.
  • Removes every ASCII digit to form the text prefix, concatenates all digits to form one number, increments it and pads to the original total digit count. Embedded digit groups are not incremented independently: A12B003 becomes AB12004.
  • The result is trimmed. For enabled methods, no digits means append 1 and an empty numbering basis produces '1'. Numeric overflow/very long references are not guarded here.
  • This does not update a counter, reserve uniqueness, create a job or retry collisions. Concurrent callers can receive the same suggestion.

See it in Fieldmotion

CRM1

Open the job Create dialog and use automatic reference selection; jobEdit.js requests Jobs_getJobRefNext. Asset Maintenance creation and server-side job creation/import/copy paths also use it.

CRM2

Open the job Create dialog. lib/jobEdit.js includes Jobs_getJobRefNext in its initial request batch and uses the result for the reference input.

Related endpoints