• Kellee17
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Please help, I am new to developing / Apex code and am trying to set up a trigger to update a picklist field (on an Activity)based on a different Object's picklist entry (User) - the ultimate aim is to set colours in a dashboard the same in two different objects - Activities and Opportunities...

 

I am getting the following error:

Error: Compile Error: Invalid bind expression type of SOBJECT:User for column of type String at line 3 column 92

 

And honestly I have no clue what I need to do to fix this...!

 

Here is my first attempt:

 

trigger UpdateDepartmentPicklist on Task (before update){
        for(Task tsk : Trigger.new){
        List<User> listUse = [Select Department_picklist__c from User where Owner_ID__c =: tsk.CreatedBy];  for
    (User use : listUse){
       Tsk.Owner_Department_Picklist__c = Use.Department_picklist__c;
            }
    update listUse;
     }  
}       

 

 

Many thanks for any assistance or tips!

Cheers,

Kelly

 

Please help, I am new to developing / Apex code and am trying to set up a trigger to update a picklist field (on an Activity)based on a different Object's picklist entry (User) - the ultimate aim is to set colours in a dashboard the same in two different objects - Activities and Opportunities...

 

I am getting the following error:

Error: Compile Error: Invalid bind expression type of SOBJECT:User for column of type String at line 3 column 92

 

And honestly I have no clue what I need to do to fix this...!

 

Here is my first attempt:

 

trigger UpdateDepartmentPicklist on Task (before update){
        for(Task tsk : Trigger.new){
        List<User> listUse = [Select Department_picklist__c from User where Owner_ID__c =: tsk.CreatedBy];  for
    (User use : listUse){
       Tsk.Owner_Department_Picklist__c = Use.Department_picklist__c;
            }
    update listUse;
     }  
}       

 

 

Many thanks for any assistance or tips!

Cheers,

Kelly