• Mark E 3
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am spending too much time on this - and I thought this would be REALLY easy.

GOAL:  Update USER custom fields with custom fields from TASK on TASK CREATE.  Here's what I tried - it compiles, but does not work:

trigger UpdateLastChkInOnUser on Task (after insert) {
for(Task t: Trigger.new)
{
   User u = [Select Id from User where Id = :t.whoId] ;
   u.LastChkIn_DateTime__c = t.Check_In_Date_Time__c ;
   u.LastChkIn_Latitude__c = t.Check_In_Latitude__c ; 
   u.LastChkIn_Longtitude__c = t.Check_In_Longtitude__c ;
   update u;
}

}
I am spending too much time on this - and I thought this would be REALLY easy.

GOAL:  Update USER custom fields with custom fields from TASK on TASK CREATE.  Here's what I tried - it compiles, but does not work:

trigger UpdateLastChkInOnUser on Task (after insert) {
for(Task t: Trigger.new)
{
   User u = [Select Id from User where Id = :t.whoId] ;
   u.LastChkIn_DateTime__c = t.Check_In_Date_Time__c ;
   u.LastChkIn_Latitude__c = t.Check_In_Latitude__c ; 
   u.LastChkIn_Longtitude__c = t.Check_In_Longtitude__c ;
   update u;
}

}