W095: Delete location
Removes a fulfillment location that nothing references. Triggered from Settings, Fulfillment locations. The in-use check is broad: POs, WOs, SOs, and both inventory ledgers all block deletion.
Steps
-
Check usage across every domain. Call
Locations.isInUse, which returns counts across POs, WOs, SOs, and both inventory ledgers. -
Refuse if any count is non-zero. Return the per-domain counts in the error payload so the UI can guide the user to the right place to clean up.
-
Delete the location. Call
Locations.delete.
Returns
Nothing.
Business rules
- Any reference blocks deletion. A location used as a PO ship-to, WO work site, SO fulfillment location, or as a bin in either ledger cannot be deleted.
Errors
NotFoundError. The location was not found.InUseError. One or more domains reference this location; counts are returned per domain.