+ Start a Discussion
ethanoneethanone 

How do I move old notes to new enhanced notes?

Any idea how to move old notes to the new enhanced notes and maintain the original owner/creator and date/time?
Best Answer chosen by ethanone
JustAGirlyGeekJustAGirlyGeek
Hi ethanone,

Here is a knowledge article on how to import notes into the ContentNote (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentnote.htm) object:

https://help.salesforce.com/apex/HTViewSolution?id=000230867&language=en_US (https://help.salesforce.com/apex/HTViewSolution?id=000230867&language=en_US)

In order to over-ride the system fields in SF on import (won't work on editing records), you need to follow this knowledge article to enable the 'create audit fields' feature:

https://help.salesforce.com/apex/HTViewSolution?urlname=Enabling-Create-Audit-Fields&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=Enabling-Create-Audit-Fields&language=en_US)
https://help.salesforce.com/apex/HTViewSolution?urlname=How-to-specify-the-values-in-Created-By-Created-Date-Last-Modified-By-ID-Last-Modified-Date&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=How-to-specify-the-values-in-Created-By-Created-Date-Last-Modified-By-ID-Last-Modified-Date&language=en_US)

Lastly, this object isn't listed as one of the objects you can set the values for system fields but I haven't tested it to know for sure (it is a newer object):

https://help.salesforce.com/apex/HTViewSolution?urlname=Considerations-before-having-Create-Audit-Fields-enabled&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=Considerations-before-having-Create-Audit-Fields-enabled&language=en_US)

Hope this helps!

All Answers

JustAGirlyGeekJustAGirlyGeek
Hi ethanone,

Here is a knowledge article on how to import notes into the ContentNote (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentnote.htm) object:

https://help.salesforce.com/apex/HTViewSolution?id=000230867&language=en_US (https://help.salesforce.com/apex/HTViewSolution?id=000230867&language=en_US)

In order to over-ride the system fields in SF on import (won't work on editing records), you need to follow this knowledge article to enable the 'create audit fields' feature:

https://help.salesforce.com/apex/HTViewSolution?urlname=Enabling-Create-Audit-Fields&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=Enabling-Create-Audit-Fields&language=en_US)
https://help.salesforce.com/apex/HTViewSolution?urlname=How-to-specify-the-values-in-Created-By-Created-Date-Last-Modified-By-ID-Last-Modified-Date&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=How-to-specify-the-values-in-Created-By-Created-Date-Last-Modified-By-ID-Last-Modified-Date&language=en_US)

Lastly, this object isn't listed as one of the objects you can set the values for system fields but I haven't tested it to know for sure (it is a newer object):

https://help.salesforce.com/apex/HTViewSolution?urlname=Considerations-before-having-Create-Audit-Fields-enabled&language=en_US (https://help.salesforce.com/apex/HTViewSolution?urlname=Considerations-before-having-Create-Audit-Fields-enabled&language=en_US)

Hope this helps!
This was selected as the best answer
ethanoneethanone
Thanks!
As I was poking around yesterday, i found that my enhanced notes are spread across two objects, the ContentDocument object and the ContentVersion object. Now you've pointed out that these notes are also in the ContentNote object, which is also related to the ContentVersion object. This seems like ContentDocumet and ContentNote are at least somewhat redundant. What is going on here?

Also, it ContentDocument and ContentNote are not available through the Data Loader tool. Does that mean export/import has to be done through SOAP API?
JustAGirlyGeekJustAGirlyGeek
When I looked in Data Loader last week it was in there. Do you have the latest version of Data Loader installed?
ethanoneethanone
oops, i was using v34, but now I'm using v35. I see ContentDocument and ContentVersion in the export options, but only ContentVersion in the insert options. I don't see ContentNote in either opion. 

It still seems like the process has to occur via the api. The only content I'm able to find is in the ContentVersion.VersionData field. Further including this field causes different behavior when queried from the ForceIDE vs. the Developer Console vs. SF Workbench. What i get back in the VersionData field is sometimes a base64 result and sometimes an API path.
JustAGirlyGeekJustAGirlyGeek
I just checked in an org with Enhanced Notes enabled and found it listed under Note (ContentNote).
ethanoneethanone
Ah, ok i was looking in my production org, where I hadn't enabled notes yet. In my sandbox, where I have enabled it, i see it now in both export and insert operations. Now I can experiment with inserting and the dates/owner and converting content to base64.

Thank you so much!
JustAGirlyGeekJustAGirlyGeek
Happy to help! Btw, please choose a best answer so that others may benefit from this post. Thanks!
aam1raam1r
I know this is a long time after, but i tried this for the new Notes (ContentNotes).  However, the audit fields do not show up for mapping for this object.
Douglas C. AyersDouglas C. Ayers
To help folks migrate from Classic Notes (Note) to Enhanced Notes (ContentNote) I've developed open source project on GitHub:

https://github.com/DouglasCAyers/sfdc-convert-notes-to-chatter-notes

And if you're converting notes you might also want to convert Classic Attachments (Attachment) to Salesforce Files (ContentVersion):

https://github.com/DouglasCAyers/sfdc-convert-attachments-to-chatter-files
Pedro MoralesPedro Morales
@Douglas C. Ayers, your note conversion code works very well.  Thanks for contributing to the open source community!