I have a before update trigger that I want to use to capture updates to previous version records in the contentversion. I want to add additional text to the reasonchange that was added by the user before the record is updated. However when testing, for some reason the newly uploaded version, aka the insert record, is the only record in the batch. Which shouldn't be right?
This is a test trigger I used to test. It fails indicating ReasonForChange is not writeable.
trigger ContentVersionTrigger on ContentVersion (before update) {
for(ContentVersion cv : trigger.new) {
cv.ReasonForChange = 'Testing';
}
}
Is there a way to update the previous version's reasonforchange field upon revision of a published content?