Posts

Showing posts with the label library

Salesforce Fact #776 | Error while deleting file association with library

Have you encountered this error:  Cannot complete this operation. You cannot remove a document from its owning library. So, whenever we associate a file to a library, a record gets created in each of ContentWorkspaceDoc and ContentDocumentLink objects. If we try to delete any of these records, it throws the error. So, the file or the ContentDocument record itself needs to be deleted to delete the associations. Reference:  https://salesforce.stackexchange.com/questions/317241/delete-a-contentdocumentlink-of-library-file

Salesforce Fact #774 | Check if a file is shared with a library

Image
How to know if a File has been shared with a Library? Once a file is added to a Library, a record is created in the ContentWorkspaceDoc object. We can query this object with the ContentDocumentId to check if a file is shared with a library. Reference:  https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contentworkspacedoc.htm Attached are the screenshots.