Loading

Extract Parent ID of ContentNotes Object in Salesforce

Дата публикации: May 20, 2025
Описание

Unlike Notes, the ContentNotes object does not include a Parent ID when you export using API, Data Loader, or Data Export.  Instead, ContentNote relies on the ContentDocumentLink object to establish relationships to other records.  See this diagram to view the ContentNotes object and relationships with other objects. 

Решение

To identify the parentID for Content Notes, you need to follow a two-step process


A. Extracting Content Notes IDs

 
  1. Perform export using Data Export (Navigate to Setup and enter Data Export into Quick Find). For more, please review Export Backup Data from Salesforce and Data Export FAQ.
  2. Select option Include Salesforce Files and Salesforce CRM Content document versions.
  3. Deselect option Replace carriage returns with spaces
  4. In object list, select ContentVersion and initialize the export.
  5. When the file becomes available, download and unzip it. 
  6. This export will contain a .csv file and a folder called ContentVersion. 
  7. Open the 'ContentVersion' .csv file and it will contain details about all of the files. To filter only ContentNotes data, apply filter to column header in MS Excel by selecting data with following column values: IsLatest = 1, FileType = Snote.
  8. Copy this data into another .csv file and save it. 



B. Extracting parent IDs of Content Notes

 
  1. Open Data Loader and click on Export All.
  2. Select the option Show all Salesforce objects and select the object ContentDocumentLink
  3. Choose a target where the file will be stored. 
  4. From the file generated  in process A step 8, select data that is present in column "ContentDocumentId," as this data will be used in the where clause of the query given in the next step.
  5. Copy the query shown below and replace the value within parentheses with "ContentDocumentId" obtained from above steps, which will give you parent IDs and titles of Content Notes: 
 
Example Query:

SELECT Id, ContentDocumentId, ContentDocument.Title, ContentDocument.FileType, LinkedEntityId, ShareType, Visibility FROM ContentDocumentLink where ContentDocumentId in ('06941000000WEeiAAG','06941000000WEejAAG','06941000000WEekAAG') 
 
Note: The data within the parenthesis is just a sample data to showcase format that needs to be used. As you might have multiple records, you can collate the IDs or CONTENTDOCUMENTIDs by using Excel formulas like "CONCATENATE."
 
 
  1. The column "LinkedEntityId" will contain the parent record IDs and owner IDs for the Content Notes. Filter the data to show only record values.
Дополнительные ресурсы

ContentNote 

Номер статьи базы знаний

000381453

 
Загрузка
Salesforce Help | Article