"Document with ID does not have an owning Library" error when upgrading to version 3.6 and above
Table of Contents
Description
Error:
When upgrading to RIO Education version 3.6 and above, you may encounter the error "Document with ID does not have an owning Library" for both "rioed" and "rioed_eddie" content documents.
Root cause:
This could be due to the related content document not being shared with anyone in the Salesforce org. Please verify this by following the steps below:
- Go to Setup > Feature Settings > Salesforce Files > Asset Files.
- Look for the asset file with Unique Name = rioed.
- Click on the record.
- Click on the "View" link next to the "View File Details" to view the content document.
- Verify if the file is not shared with anyone.
Resolution
Both of the content documents "rioed" and "rioed_eddie" need to be shared at least to Salesforce org to solve the error. Please run the following script in developer console to fix the data issue:
ContentDocumentLink rioed_cdl = new ContentDocumentLink(); rioed_cdl.LinkedEntityId = '<salesforce org id>'; rioed_cdl.ShareType = 'V'; rioed_cdl.Visibility = 'AllUsers'; rioed_cdl.ContentDocumentId = '<copy the content document id from the url for rioed file>'; insert rioed_cdl; ContentDocumentLink rioededdie_cdl = new ContentDocumentLink(); rioededdie_cdl.LinkedEntityId = '<salesforce org id>'; rioededdie_cdl.ShareType = 'V'; rioededdie_cdl.Visibility = 'AllUsers'; rioededdie_cdl.ContentDocumentId = '<copy the content document id from the url for rioed_eddie file>'; insert rioededdie_cdl;