W047: Update customer
Edits a customer's header fields, including classifiers and the parent link. Triggered from Customer Detail.
Steps
-
Load the customer. Call
Customers.getCustomerById. -
Reject hierarchy cycles. If the patch changes
parentId, walk up the proposed parent chain and reject if it loops back to this customer. -
Validate any new classifier refs. Confirm any new type, segment, or broker exists in this org.
-
Apply the patch. Call
Customers.updateCustomer.
Returns
The updated customer.
Business rules
- Hierarchy must remain a DAG. Parent cycles are rejected at step 2.
Errors
NotFoundError. The customer or a referenced row was not found.ValidationError. The proposed parent would create a cycle.