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

Trigger to update a field when a task is created on contact
I'm new to triggers. I want to update a custom field (checkbox on Contacts) when a task or event is created/updated on Contacts by all profiles but admins.
Can someone please give me a sample code?
Can someone please give me a sample code?
I think its easier do this process with a workflow in Process Builder because is a simple operation.
Create the process starting when a Task is created or updated, add a criteria if you wish and on action select an the checkbox 'Select an object related to Task', select fhe Contact field and value desired.
If this resolve your issue, mark as best answer.
Thanks.
Rohit Sharma - It is not possible by workflow as task is a cross reference object, i would not be able to do any updates on contacts? I think trigger might help in this regard.
I add some screenshot that I hope help you.
1. In the drop-down setting the action, mark Update Records.
2. In the record type, you can choose 'Select a record related to the Task'.