## TL;DR
Salesforce blocks deactivation while the user owns records. Transfer ownership to an active user first, using the deactivate flow's transfer option or mass transfer, then deactivate. The license frees when deactivation completes.

```text
"failed to deactivate user" user still owns records Salesforce
```

## Use this when
- Deactivating a user fails citing owned records.
- Offboarding is stuck on the Salesforce step.
- The error lists records or objects still owned.

## Not for this skill when
- Deactivation fails for another reason. Read the actual error.
- The goal is only to remove the license. Deactivation frees it, but check the license type rules.
- The user must keep access. Then do not deactivate at all.

## Steps
1. Note the owned records or objects named in the error. Verify: you know the scope of the transfer.
2. Use Setup, then Users, then deactivate, choosing the transfer target user, or run mass transfer first for large sets. Verify: the transfer target is active and appropriate.
3. Confirm the transfer completes. Verify: the departing user owns nothing.
4. Deactivate the user. Verify: status is inactive.
5. Confirm the license is freed in Company Information. Verify: the seat is reclaimed.

## Variant phrasings
### cannot deactivate Salesforce user
The plain-English search.
### transfer records before deactivate
The action-first phrasing.
### user owns records error
The cause-first phrasing.

Compatibility: Salesforce user deactivation, all editions.

## Why it happens
Record ownership is a hard dependency in Salesforce. The platform will not orphan records, so deactivation is gated on transferring them away first.

## Edge cases / pitfalls
- The user owning records in objects the transfer tool skips; check queues, dashboards, and reports.
- Integration users owning records: transferring to a human may break the integration's expectations.
- The transfer target lacking access to the records being transferred.
- Large transfers timing out; run them in batches.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_8S79zXB7I5Zjv43nU75cBA
