You need to sign in to do that
Don't have an account?
Jerrod Knapp 11
I need to update a contentversion field from a custom object
I know that the contentversion object is a tricky monkey but I need to update a custom field (chekcbox) on that object from a related custom object. Their relation is the contentversion id. I tried flow and process builder but it's just not working... I'm hoping that someone can help with a trigger. Here is how it goes...
when
CustomObject__c.CustomCheckbox__c field gets set to = True
then
ContentVersion.CustomCheckbox gets set to = False
Thanks ahead of time to anyone who gives me a hand with this.
Sincerely,
Jerrod.
when
CustomObject__c.CustomCheckbox__c field gets set to = True
then
ContentVersion.CustomCheckbox gets set to = False
Thanks ahead of time to anyone who gives me a hand with this.
Sincerely,
Jerrod.
In the meantime try this trigger.....
Let me know if this helps, or if you hit any errors,
Shawn
trigger UpdateContentVersionCheckBox on DocumentProxy__c (after insert, after update) {
List<ContentVersion> cv = new List<ContentVersion>();
for(DocumentProxy__c dp : Trigger.new){
if(dp.ProcessApproved__c == True) {
cv.add(dp.ContentVersion__r.Id);
}
}
If(cv.size()>0){
cv.Not_On_Web__c = True;
}
}
I get this error: Error: Compile Error: Variable does not exist: ContentVersion__r at line 7 column 24