Loading

Unable to deactivate User due to custom User Hierarchy field

Publiceringsdatum: Feb 20, 2024
Beskrivning

When you attempt to deactivate a User in Data Loader, you may encounter an error message: 

Cannot complete this operation. Cannot inactivate user that is the value of a hierarchy field: User Hierarchy. : Jane Doe

This error occurs when the user you are attempting to inactivate is referenced with a custom User Hierarchy field in the referenced user, Jane Doe in our example error above. For more information on why this occurs, review the Considerations for Deactivating Users documentation. Below is an introductory video on deactivating users. 

Lösning

If you are unable to delete and purge the field as recommended in the Considerations for Deactivating Users  documentation, you may be able to use Data Loader to bulk remove the field values to allow you to deactivate the user.

To bulk erase the field value:

  1. Launch Data Loader and choose Export
  2. Login to the organization
  3. Choose the User object and a location for the file extraction.
  4. Click Next and then Yes
  5. Select ID, First Name, Last Name, the custom Hierarchy field, and any other fields that will help you to validate the team members to be removed.
  6. Set a clause to filter the export and choose Add Condition.
    • Field = the custom Hierarchy field
    • Operation = Equals 
    • Value = the ID of the user you are attempting to inactivate
    • The resulting query should look something like: Select FirstName, Id, LastName, User_Hierarchy__c FROM User WHERE User_Hierarchy__c = '0051P00000XXXXX'  
  7. Click Finish, Yes, and view the extraction
  8. Click Open in external program
  9. In the CSV file, erase the value in the custom Hierarchy field and Save the file as a new CSV file. 

    Note: We recommend saving as a new file to retain the original export as a backup. 

  10. Once you have the new file saved, return to Data Loader.
  11. Click Settings and then Settings again. 
  12. Check the box 'Insert null values' and save. This will allow you to nullify the custom Hierarchy field.
  13. Click Update
  14. Choose User and the new CSV file you just saved
  15. Click Next and OK
  16. Click Create or Edit a Map and map only the ID and custom Hierarchy field.
  17. Click Next and Finish
Once this update is complete, the custom Hierarchy field will be cleared and you can deactivate the original User as intended. 


Salesforce Support Video:
How to Download and Install Data Loader
Knowledge-artikelnummer

000384962

 
Laddar
Salesforce Help | Article