At times, you might encounter an issue with documents linking from Dynamics CRM to SharePoint. After a document migration from the source systems, the count of folders created and documents linked may all look well. All documents are present at the SharePoint location, but upon accessing the documents from a CRM record, you get an “Unexpected Error” message as below:
To resolve this issue, go to Settings > Document Management > SharePoint Document locations.
Here are the steps to follow:
- Look for the record that is regarding the record in issue.
- Open the record.
- Note the folder name (1) – this is to take the documents backup and delete/ rename in SharePoint.
- Deactivate the record.
- Open the CRM entity record in issue > Documents. The “Unexpected Error” would not be there any more. Depending on your settings, you would either get a prompt to confirm document location, or you would see the option to “Add Location” as below.
- Click Add Location. Update details if required. Note the folder Name (2).
- Click Save.
- Go to the SharePoint site (https://<company>.sharepoint.com/sites/<organization>).
- Click on “Site Contents” and go to folder (1).
- Download the documents, then rename this record.
- Now go to folder (2). Drag drop all downloaded documents from previous step here. Give it a few seconds. Refresh Dynamics CRM and check for the documents in CRM
Few reasons for this issue could be having special characters in the folder location names/very long folder names.
Note: You need “System Administrator” role both in Dynamics CRM and SharePoint to perform all the steps above.