function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Merry SMerry S 

Trying to create a tigger to update a field on the contact

Hello,

 

I am trying to create a trigger that will update the field "Last Qualifer" on the contact with whomever was the last person assigned a  task. (Assigned To).

 

I am having trouble with this since activites is not really an object, and I am super new to all of this.. any help would be great - or pointer in the right direction.

crop1645crop1645

LessDefined

 

You'll need to write an after trigger on Task; using the whoId field of Task to decide if the Task belongs to a Contact, and then you can update the Contact

SammyComesHereSammyComesHere

Contact is associate with Task or Events (Activities) by Who Id Field and you can Query on the Event or Task Object with Who Id in where clause getting you the activities associated with that contact.