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 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.

  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 open Users.

    In Salesforce Lightning, navigate to Users > Users.

    In Salesforce Classic, navigate to Manage 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