You need to sign in to do that
Don't have an account?
Hanna Bergsma
Trigger to update owner of content version to related Case field
Is there a way to set the ownerId = Content version> email> Case>Last Modified By?
I want to set the owner of the file to whoever has been working the case. These files are created via email-to-case. Please help with actual suggestions, not links. I have been reading blogs for days and nothing has worked. I'm at wits end on how to allow my users to delete Files on emails.
trigger ConDoc on ContentVersion (after insert) {
List<ContentVersion> conver = [SELECT Id, Title, OwnerId FROM ContentVersion WHERE Id IN: Trigger.newMap.keySet()];
for (ContentVersion CV: conver){
CV.OwnerId= '3D00GF0000007fwJR';
CV.Title = 'HannaTest';
}
update conver;
}
I want to set the owner of the file to whoever has been working the case. These files are created via email-to-case. Please help with actual suggestions, not links. I have been reading blogs for days and nothing has worked. I'm at wits end on how to allow my users to delete Files on emails.
trigger ConDoc on ContentVersion (after insert) {
List<ContentVersion> conver = [SELECT Id, Title, OwnerId FROM ContentVersion WHERE Id IN: Trigger.newMap.keySet()];
for (ContentVersion CV: conver){
CV.OwnerId= '3D00GF0000007fwJR';
CV.Title = 'HannaTest';
}
update conver;
}
Are you getting any issues with this code? Can we connect to discuss the issue and find out a solution for this?
Thanks,
Abhishek Bansal.
Email: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
It seems to be working fine, I just want to have the case owner's ID instead of hard coding an ID in Owner.id field. The file is an attachment to an email that came in via email-to-case