Overview:
When a new document is uploaded with a name that has been already used, the following error occurs:
This {Document / Dashboard / View / etc.} Unique Name already exists or has been previously used. Please choose a different name.
The old document with the same name was deleted before, so it does not exist in the Documents.
Root Cause:
The behavior is expected, as the deletion of the old file was a soft delete only. The old file still exists in the Recycle Bin and on Salesforce Backup Servers.
Solution:
There are multiple methods to avoid the error message, depending on the urgency of the document.
Method 1:
- Log in to the affected org with an Admin user.
- Go to the Recycle Bin.
- Select All Recycle Bin from the drop-down menu if a different user deleted the document.
- Search for the problematic document and delete it. Now the file exists only on the Salesforce Backup Servers.
- Wait for the cleanup of the servers. Salesforce does it during weekends.
- Upload the desired file with the desired name. (potentially on the upcoming week)
Method 2:
- Log in to the affected org with an Admin user.
- Go to the Recycle Bin.
- Select All Recycle Bin from the drop-down menu if a different user deleted the document.
- Select the problematic document and click Undelete.
- Rename the old document so the API name should also change.
- Upload the new document with the desired name.
Method 3:
- Use a different name (new API) for the document to be able to upload it.
Note:
There are sometimes requirements in the naming convention for a special document.
Example: vmobile-image-home.XXX for the company logo.
In this case, use a different file extension (JPG instead of PNG for instance), so the generated API name will be unique again.
Related Documentation:
Salesforce Help Documentation: View, Restore, and Manage the Recycle Bin in Salesforce Classic