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
Lindsey Walgamott 5Lindsey Walgamott 5 

Timezone Question/Integration

I need additional help with this:

If you want to copy timezone information from contact to related tasks then write a trigger on Task.
trigger updateTimeZone on Task (before insert, before update) { //Contact Ids Set <ID> contactIDs = new Set <ID> (); for (Task t:{ if (t.whoId != NULL){ contactIDs.add(t.whoId); } } //Create a map to match the task related to ID's with their corresponding account ID's Map<ID, Contact> contactMap = new Map<ID, Contact> ([Select ID, TimeZone__c from Contact where ID in :contactIDs]); //Check contactId and update timezone of the task for (Task t:{ if (contactMap.containsKey(t.whoId)){ t.TimeZone__c = contactIDs.get(t.whoId).TimeZone__c; } } }
Replace TimeZone__c field with the respected fields from contact and task.

**I keep getting this error when I copy and past the trigger you sent me. 
Error: Compile Error: No such column 'TimeZone__c' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 10 column 55

What do I need to do?
What do you mean by replace TimeZone__c field with respected fields contact and task?

Sorry I am new to all of this and trying to figure it all out but just hard for me.

If you could please help me or lead me in the right direction I would greatly appreciate it! 

Thank you-
Lindsey W. 
Andreea TAndreea T
Hi Lindsey,

Any update for ur question?
I would like to know how u solved the exact same problem.