Skip to main content
Hello Trailblazers :)

 

I'm trying to find a way to insert ContentDocument (New version of Notes) & relate it with existing parent records but I can't find any parentid upon fields insert mapping. I checked that ContentDocument has a relationship with ContentVersion but no parentid/firstpublishlocationid contains information about parent either.

 

Is the only way to do it 1. Insert old Notes 2. Convert old Notes into new ones using Magic Mover? I would like to avoid that since our Magic Mover tends to crash a lot.

 

Thank you in advance!
4 Antworten
  1. 10. Dez. 2019, 14:29
    Yes, but there is more to it.

     

    So how it really works is that the ContentVersion(CV) contains the data file. ContentNote is more like a wrapper(parent of ContentVersion) which can have multiple version of CV.

     

    Then ContentDocumentLink  is the junction object with Link info between the record and the note.

     

    So the first step is to create ContentVersion. The creation of CV record automatically creates a parent ContentNote record. So you will have to export the IDs of these ContentNote records. 

     

    And then create ContentDocumentLink records.

     

    For your understanding you can refer this doc

     

    https://help.salesforce.com/articleView?id=000314772&language=en_US&type=1&mode=1 (https://help.salesforce.com/articleView?id=000314772&language=en_US&type=1&mode=1)

     

    Feel free to ask any questions if there is still any confusion.
0/9000