Skip to main content
Keith Word a posé une question dans #Data Management
I need to create a trigger that would populate the Manager lookup field found on the user object.  I have a large number of Salesforce users and we are adding additional users each day.  I would prefer to complete this task via automation rather than having to manually populate this information.  Several of our reports are dependent upon the Manager field being populated.

 

If I can get this code, I will attach it to a workflow that looks at the first login for a user.  The trigger will run and populate the manager field with the person found in the role directly above the role of the running user in the role hierarchy if the manager field is blank.  I can handle the development of the workflow.  I am struggling with creating the APEX code.  In my role structure, we have a manager role that is above each rep role.  The manager role only contains 1 user.
5 réponses
0/9000