Opportunities
Set an opportunity user through the legacy name route
/a/Opportunity_setName
Set the assigned user ID through a misleading legacy route name.
When to use this endpoint
Opportunity_setName does not set an opportunity name: opportunities have no mapped name column. Use only when maintaining a legacy caller that intentionally relies on it as a duplicate of Opportunity_setUser.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Opportunity ID after integer conversion. |
val | Integer string | Yes | Replacement user_id. Text becomes zero. |
Example request
$result = FM_api('Opportunity_setName', [
'id' => '481',
'val' => '18',
]);
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 parameter: id"} | id is omitted. |
{"error":"missing or invalid parameter: val"} | val is omitted. |
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 route does not check row/user existence or exclude soft-deleted opportunities. Missing rows return success.
Side effects
- Sets
user_id, updateslast_edited, and invalidates the opportunities cache; it creates no audit/notification event.
See it in Fieldmotion
CRM1
No current production CRM1 caller was found; the inline User editor calls Opportunity_setUser.
CRM2
No direct production CRM2 caller was found.
Related endpoints
Opportunity_setUserperforms the same write under the correct name.Opportunity_updateDatais the audited CRM2 path.