This has been asked and answered before but the instructions seem incomplete or outdated.
My org used enhanced notes.
We add Notes to our Accounts and I need to insert notes and query notes already entered for updating.
When I go to an account, and select Related, here's what I see and what I need to be able to export for update and insert new records.
What are the steps to export the Title, & Text Preview for updating? I assume there is also a record ID to ensure that updates are made to the correct record.
What are the steps to insert new records with Title, Text Preview & the account record id the note should be related to?
#Saleforce Administrator #Salesforce Admin #Admin
Scenario A: Inserting NEW Notes (2 Steps)
You cannot just "insert notes to Accounts." You must create the note first, then create the link.
Step 1: Insert the Note (ContentNote)
- Prepare a CSV with 2 columns: Title and Content.
- Note: For the Content column, Data Loader requires a file path to a text/HTML file on your computer containing the note body. You cannot just put the text in the CSV cell if it's complex.
- Open Data Loader -> Insert -> ContentNote.
- Map the fields and run.
- Crucial: Save the Success file. It contains the new ID (This is the Note ID).
Step 2: Link to Account (ContentDocumentLink)
- Take the Success file from Step 1.
- Add a column LinkedEntityId (Put the Account ID here).
- Add a column ShareType (Set value to 'I' or 'V'). 'I' (Inferred) is standard for owner permissions.
- Open Data Loader -> Insert -> ContentDocumentLink.
- Map:
- ContentDocumentId -> Map to the ID from Step 1.
- LinkedEntityId -> Map to the Account ID.
- ShareType -> Map to 'I'.
- Run. Now the note appears on the Account.
Scenario B: Updating EXISTING Notes
To update, you don't touch the Account or the Link. You just update the Note itself.
- Export:
- You need to find the ID of the notes linked to your Accounts.
- Query ContentDocumentLink:
sql
SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink WHERE LinkedEntityId IN ('AccountID1', 'AccountID2', ...)
This gives you the ContentDocumentId (The Note ID).
- Update:
- Create a CSV with ContentDocumentId and the new Title or Content.
- Open Data Loader -> Update -> ContentNote.
- Map Id to ContentDocumentId (or Id if you exported from ContentNote directly).
- Prepare a CSV with 2 columns: Title and Content.