Query All Files or Notes in Salesforce

Query All Files or Notes in Salesforce

The new Note-taking tool uses the ContentNote object which is based on the ContentVersion (Salesforce Files) object. The Notes are related to other records like Accounts, Contacts, etc. via the ContentDocumentLink junction object.

As an admin with “Modify All Data” and “View All Data” permission, you can export ContentNote and ContentVersion records that are explicitly shared with you or that you own.

So what is the solution how do we export all the files and notes from an org?

In order to be able to query all files, including files in non-member libraries and files in unlisted groups, you need to enable "Query All Files" permission for your backup user. This permission is disabled by default.

"Query All Files" permission enables the ability to query ContentDocument and ContentVersion and retrieve all files in the org, including files in non-member libraries and files in unlisted groups.

_________________________________________________________________________

Steps to enable the permission for users:

  1. Set Up > Permission Set > New.
  2. Enter the preferred details.
  3. Click Save.
  4. Click App Permissions.
  5. Click Edit,
  6. Navigate to "Query All Files".
  7. Check the "Query All Files" checkbox.
  8. Click Save.
  9. After that, click Manage Assignments.
  10. Click Add Assignments.
  11. Check all Users you want to add, then click Assign.

Resource:

ContentNote ERD: ContentNote

Release note: Query All Files








 

Comments

Popular posts from this blog

Introducing Lightning Record Picker: A New Era of Record Selection

New Intelligence View for Leads and Contacts in Salesforce | Winter '24

Handling recursion in Apex Triggers