[SalesForce] Trigger to update a picklist field from another picklist field

I'm still pretty new when it comes to Apex, so I apologize in advance if this is an easy thing to fix.

I'm trying to create a trigger that auto populates a picklist field in the Lead object, based on a value of a picklist field on the User object. So if the field on the User has a value of 'a', I want a corresponding value in a different field to be populated for any leads that this user creates.

trigger DefaultBusinessDivision on Lead (before insert) 
{     
    Map<String, String> myPickListMap = new Map<String, String> {'a'=>'a', 'b'=>'b',
        'c'=>'c', 'd'=>'d', 'e'=>'e','f'=>'f', 'g'=>'g', 'h'=>'h'};

    for (Lead a : Trigger.new)
    {        
        a.Business_Division__c = myPickListMap.get(User.Default_Business_Division__c);                  
    }      
}

Attempting to save this throws the error "Incompatible key type Schema.SObjectField for MAP", should I use a different type instead of (String, String)? Business_Division__c and Default_Business_Division__c are both picklists and are the fields I need to use to update the field on the lead page.

Best Answer

There isn't a global User object, you have to query the information like this:

User u = [select Default_Business_Division__c from User where Id = :UserInfo.getUserId()];
for (Lead a : Trigger.new)
{        
    a.Business_Division__c = myPickListMap.get(u.Default_Business_Division__c);                  
}

The reference User.Default_Business_Division__c is an SObjectField token used in map-like APIs.