Loading

Error 'Cannot deactivate a User or make them inactive' on User Deactivation

Publiseringsdato: Oct 13, 2022
Beskrivelse
When deactivating a user, the following error occurs after removing the 'Active' checkbox and saving the record:

"Cannot inactivate user that is the value of a hierarchy field:{Fieldname}"

This error occurs when the User object has a custom field that has "Hierarchy" as the data type.
 

Steps to Reproduce:

  1. Create a custom field on User object.
  2. Use the "Hierarchy" data type.
  3. Populate one of the active Users name. Example, User A has been selected in another active user (for example, User B) custom "Hierarchy" field that you just created.
  4. Now try to deactivate User A.
  5. The error that says "Cannot inactivate user that is the value of a hierarchy field: 'Custom Field Name' " will occur.
Løsning

 

Resolve a 'Cannot inactivate' error


In Salesforce Classic
  1. Click Setup.
  2. Navigate to Administer | Manage Users | Users.
  3. Check the hierarchy field for every user. This is the field with datatype 'Hierarchy' in the User object.
  4. Remove the affected username from every other user's 'hierarchy' field.
 
In Lightning Experience
  1. Click the gear icon then Setup.
  2. Navigate to Administration | Users | Users.
  3. Check the hierarchy field for every user. This is the field with datatype 'Hierarchy' in the User object.
  4. Remove the affected username from every other user's 'hierarchy' field.
 
If there are too many User records to do this manually, you may be able to use Data Loader to bulk remove the field values to allow you to deactivate the user. For detailed steps to complete this action, see Unable to deactivate User due to custom User Hierarchy field

Note: Removing the value from these field is at the discretion of the administrator of the particular org. Additionally,
before deactivating a user, make sure to confirm that they are not a  default Lead or Case owner and creator in the following areas in Setup:
 
  • Support Settings (Default Case Owner and Automated Case User)
  • Lead Settings (Default Lead Owner)
  • Web-to-Lead (Default Lead Creator)
  • Process Automation Settings (Default Workflow User)
  • Site settings (Default site user)

Note: Users can not be deleted from the organization, only deactivated. For more information, see Delete Users.



See also:
Considerations for Deactivating Users
Knowledge-artikkelnummer

000386275

 
Laster
Salesforce Help | Article