0

I want to create a lookup field to User in the Custom object. This lookup should display the list of users who are Managers of other users.

How this can be achieved.

Thanks in advance.

3 Answers 3

2

The closest I can think of if a filtered lookup where you can only lookup managers. Since the manager lookup is a recursive one on User, it would be hard to filter on I magine, unless a manager cannot have a manager.

5
  • Thanks for your reply. Could you please let me know if the solution that I have identified is the right way to go?
    – Priyanka
    Commented Oct 8, 2012 at 13:36
  • Have a checkbox Manager on User. Write a simple trigger on User, which sets the Checkbox on the Manager User. And have the filtered lookup filter by the checkbox. Commented Oct 8, 2012 at 15:41
  • @techtrekker I am new to salesforece so can you please let me know how can i set lookup filter. where can i fing this lookup filter iption? Commented Oct 9, 2012 at 6:18
  • @PramodKumar, while you create a lookup field itself you will find it in the step 3
    – Priyanka
    Commented Oct 9, 2012 at 6:50
  • @ priyanka i am using release 12 and i didn't find any lookup filter option during creation of lookup Commented Oct 9, 2012 at 7:31
0

I guess better approach for this will be make a look up field and put a lookup filter saying his role is manager or make a check box for that user of formula type and mark it then put a look up filter to get only those records

There is a field called ManagerId in User Object standard field one can use that write a small rule or trigger

3
  • Thanks for ur response. Can you please is there any way to find if a user is a manager or not by using system field itself. Already I have identified the solution as creating a custom check box field like 'IsManager' and populating this field using trigger and adding this field as filter in the lookup field. I just wanna know if there any easier way to go.
    – Priyanka
    Commented Oct 8, 2012 at 13:34
  • There is a field called ManagerId in User Object standard field one can use that write a small rule or trigger Commented Oct 8, 2012 at 14:25
  • @mohit I am new to salesforece so can you please let me know how can i set lookup filter. where can i find this lookup filter option? Commented Oct 9, 2012 at 6:18
0

Perhaps you could leverage Jeff Douglas's code here: http://blog.jeffdouglas.com/2011/02/15/find-my-salesforce-users-by-role-hierarchy/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .