I'm using the lightning-file-upload component to upload files (wow).

My question is: is it safe to add a custom lookup relationship on the ContentVersion object?

I guess I don't really understand the 'version' part of the name. Since we have to use isLatest = true when we query, does that mean the contentVersion changes on its own and therefore the custom relationship isn't reliable, in the way, that a new version would be created and that record wouldn't have the correct relationship?


It's safe to put a Lookup field on the ContentVersion object, as the Lookup value will automatically be set on a new version from the previous version

If the Lookup value is changed on the latest version, it will only affect the latest version

  • Right, do you have somewhere I can read up on that?
    – Carl-Johan
    Aug 18 '20 at 13:22
  • Sorry, don't know of any documentation on it, just answering from experience
    – Instread
    Aug 18 '20 at 13:27
  • Alright, thank you
    – Carl-Johan
    Aug 18 '20 at 13:28
  • I see this mentions that the data in the custom fields are available "for the life of the file", which I'm guessing means all ContentVersions on the ContentDocument file? help.salesforce.com/…
    – Instread
    Aug 18 '20 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.