Schedule of Rates
Find a Schedule of Rates display label
/a/ScheduleOfRates_getByNameAndCode
Find a Schedule of Rates row by its exact combined “name (code)” display label.
When to use this endpoint
Use ScheduleOfRates_getByNameAndCode only for the legacy picker label produced by CRM1. It is not a separate name-and-code parameter lookup.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional page or role-permission check.
All reads and writes use the authenticated tenant. The CRM screens apply client-side Schedule of Rates permissions, but those controls are not repeated by this endpoint.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Trimmed exact combined label in the form Name (CODE). A blank code therefore uses Name (). |
Example request
$rate = FM_api('ScheduleOfRates_getByNameAndCode', [
'name' => 'Annual service (AS-01)',
]);
Example response
{
"id": "430001",
"name": "Annual service",
"code": "AS-01",
"cost": "150",
"archived": "0"
}
The example is abbreviated. A match returns every stored table column, with stored JSON left encoded.
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 parameter: name"} | The combined label is absent or blank after trimming. |
false | No exact combined label matches. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The comparison follows the tenant database collation. There is no substring search or independent code parameter.
- Duplicate combined labels are possible; the query has no explicit order, so callers must not rely on which duplicate row is returned.
- Archived rows are eligible. There is no pagination.
See it in Fieldmotion
CRM1
The legacy Schedule of Rates picker converts its selected display text back to a row through this endpoint.
CRM2
No direct CRM2 caller was found; CRM2 list pickers retain IDs rather than reverse-resolving display labels.
Related endpoints
ScheduleOfRates_getretrieves a known ID.ScheduleOfRates_listsupplies picker rows.