When performing a SOQL (Salesforce Object Query Language) query on Enhanced Notes in Salesforce, a user may be able to view a note in the Salesforce UI but cannot retrieve it when querying the ContentNote object without a WHERE clause.
Key Objects:
This behavior occurs because note visibility in the UI is inherited from the parent record's sharing settings. However, SOQL queries on ContentNote and ContentDocument follow Content sharing rules, which are separate from record-level sharing. A user can query a specific note by its record ID using a WHERE clause, but a broad query without a WHERE clause returns only notes where the user has been explicitly granted Viewer or Collaborator sharing access.
Select Id from ContentNote where id = '069xxxxxxxxx';
Select Id from ContentNote;
The Enhanced Note's Content Sharing settings are not configured to grant the querying user Viewer or Collaborator access. This is why the note is visible in the Salesforce UI (via parent record access) but absent from unrestricted SOQL queries on the ContentNote object.
Select Id from ContentNote;
Note: Salesforce Administrators cannot change Content Note Sharing Settings via API, so it may not be possible to update sharing settings for large volumes of notes programmatically.
For bulk data export scenarios such as data backup or migration, use the "Export All" option rather than attempting to query all ContentNotes through Data Loader. Sharing restrictions on ContentNote will prevent complete retrieval via SOQL when querying without a WHERE clause.
000384917

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.