You need to sign in to do that
Don't have an account?
dfiorent
Creating a trigger on Event to update an Event custom field with a value from Contact
I am trying to write a trigger on Event what will update a custom field on Event with a value from the Contact. (We want to capture the value in this field at the time of the call). I thought that this would be fairly easy, but I am having difficulties. Has anyone done something similar?
Any help would be greatly appreciated!
Hi,
The below code might help you.
trigger UpdateContact on Event (before insert, before update) {
for(Event e:trigger.new)
{
Contact c= [select Id, Name from Contact where id=:e.whoId];
e.CustomFeild__c = c.Name;
}
}
This is just a sample trigger. This will not work if you are doing bulk uploads. You need to enhance it.
Thanks
Thank you so much! I was making it much more complicated that it needed to be.