Loading

Perform SOQL query on all enhanced notes records

Veröffentlichungsdatum: Oct 13, 2022
Beschreibung

In a particular scenario, user cannot access all Enhanced Notes records via SOQL query although these records are visible to the same user in the UI.

  • User is able to view Notes because of 'view' access to the parent record.
  • User is also able to query the same ContentNote or ContentDocument (but only with individual record Id with WHERE condition). 

Sample Query format

Select Id from ContentNote where id = '069xxxxxxxxx';

However, if the SOQL query is run without WHERE condition like below, this specific Note is not returned in the list.

Select Id from ContentNote;
Lösung
  • The Note is visible to the user in the UI as a part of 'view' access to the parent record.
  • As an exception, users should be able to query the ContentNote or ContentDocument with individual record Id with WHERE condition. 

Sample Query format

Select Id from ContentNote where id = '069xxxxxxxxx';
  • Open the Content Note on UI and see that the Sharing settings for the note is not set to either Viewer or Collaborator for the intended user. This is the reason that other users or admins are unable to query the record.
  • Change the sharing setting of the record to either Viewer or Collaborator. Run the query again without where condition. User will be able to see the missing record appear in the list.

Note: Admins cannot change the Sharing Setting via API so it may not be possible for them to change the settings for all the records together. So, for scenarios like data backup or migration use 'export all' option as an alternate instead of exporting all ContentNotes through Data Loader.

Nummer des Knowledge-Artikels

000384917

 
Laden
Salesforce Help | Article