Skip to content

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:

  1. Click to enter Setup, then navigate to Feature Settings > Salesforce Files > Salesforce CRM Content.
  2. Select the checkbox Enable Salesforce CRM Content.
  3. Click Save.

To allow a user accessing Salesforce CRM Content:

  1. Click to enter Setup, then navigate to Users > Users.
  2. Click Edit in the row of the user to be edited.
  3. Select the checkbox Salesforce CRM Content User.
  4. Click Save.

Related information:

Customize Content Settings in the Salesforce Help
Edit Users in the Salesforce Help