Summary:
Org 1 wants to be able to access data that lives in Org 2. For most use cases, we have this figured out using the Salesforce Connect Cross-Org Adapter.
However, there is a specific need for the org to access Notes. The org is using “Enhanced Notes” which uses the ContentNote
object. The Notes are related to other records like Accounts, Contacts, etc. via ContentDocumentLink
junction object.
What I have found so far is that with ContentNote
and ContentVersion
, you can only export/query the records that are explicitly shared with you or that you own.
The Issue:
The issue I am facing on this is when using the Salesforce Connect adapter to expose the ContentNote
object, there is no data being passed over. I believe the reason for this is because the API user is not associated with the entity/record that the note is attached to?
My Test:
I ran the query on the shared object using the following:
SELECT ... FROM ContentNote__x
I am only getting rows back where the API user was the one who created the note. I am unable to see any notes that were created by another user.
When creating the notes, there is the text “Visibility Set by Record” (example image attached) which leads me to believe that this note is only viewable by those associated with the Contact/Account/Lead etc. in some way that the note is being created for. This poses a problem for me.
The Question:
Is there a work-around / hack where I would be able to somehow allow this API user, whether it be through a permission set, role etc, be able to access all notes? If not access to the notes directly, what about associating the user in some way to the originating record so that the API user somehow relates to the Contact or Lead that this note was created on?
References to my Research:
https://douglascayers.com/2017/06/26/how-to-export-notes-from-salesforce/
https://help.salesforce.com/articleView?id=notes_considerations.htm&type=5