You need to sign in to do that
Don't have an account?

Create Task using ContentVersion object in Apex
Hi..,
Whenever i uploaded a new file doc related to Case record, i want to create new Task which needs to be assigned to Case Owner.
so, suggest me any ideas to fulfill this requirement.
Thanks.
Whenever i uploaded a new file doc related to Case record, i want to create new Task which needs to be assigned to Case Owner.
so, suggest me any ideas to fulfill this requirement.
Thanks.
try below trigger.
don't forget to mark it as best answer if it helps you.
Thank you
All Answers
The trigger code can be as below.
If this solution helps, Please mark it as best answer.
Thanks,
Please try the below tigger code surely it will work:
1. Write the trigger in ContentDocumentLink for this scenario will helps to eliminate Additional SOQLS...
2. You have to the check the LinkedEntityId is case Object or not...
if(cn.LinkedEntityId != null && cn.LinkedEntityId.getSObjectType() == Case.sObjectType){
3. Try to avoid for loops inside for loop... Trigger should be in bulkified...
Thanks,
Maharajan.C
try below trigger.
don't forget to mark it as best answer if it helps you.
Thank you
Please mark it as best answer if it helps you.
your like and best mark give us motivation to help others.
Thank you