0

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?

1 Answer 1

1

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

4
  • Right, do you have somewhere I can read up on that?
    – Carl-Johan
    Commented Aug 18, 2020 at 13:22
  • Sorry, don't know of any documentation on it, just answering from experience
    – Instread
    Commented Aug 18, 2020 at 13:27
  • Alright, thank you
    – Carl-Johan
    Commented Aug 18, 2020 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
    Commented Aug 18, 2020 at 13:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .