W158: Update order channel
Renames or recolors an existing channel. Triggered from Settings, Order channels.
Steps
-
Load the channel. Confirm it exists in this org.
-
Check name uniqueness if changed. Same rule as create (W156).
-
Apply the patch. Call
SalesOrders.updateChannel.
Returns
The updated channel row.
Business rules
- Renames preserve history. Channels are looked up by id; SOs already using this channel continue to reflect the new name automatically.
Errors
NotFoundError. The channel was not found.ValidationError. Name collision.