How to avoid ContentWorkspaceDoc
errors?
When trying to access Salesforce Files, like, for example, when sending invoice emails with the PDF files attached, users may get the following error message:
First error: No valid target (sObject, sObjectType or sObjectName) set for query (ContentWorkspaceDoc) or insufficient permissions!
To avoid this error and allow for the intended operation, make sure that
- Salesforce CRM Content is enabled for your org
- The user is set up as a Salesforce CRM Content User
To enable Salesforce CRM Content for your org:
-
Click to enter Setup, then open Salesforce CRM Content.
In Salesforce Lightning, navigate to Feature Settings > Salesforce Files > Salesforce CRM Content.
In Salesforce Classic, navigate to Build > Customize > Salesforce Files > Settings > Salesforce CRM Content.
-
Select the checkbox
Enable Salesforce CRM Content
. - Click Save.
To allow a user accessing Salesforce CRM Content:
-
Click to enter Setup, then open Users.
In Salesforce Lightning, navigate to Users > Users.
In Salesforce Classic, navigate to Manage Users > Users.
-
Click Edit in the row of the user to be edited.
- Select the checkbox
Salesforce CRM Content User
. - Click Save.
Related information:
Customize Content Settings in the Salesforce Help
Edit Users in the Salesforce Help