Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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.

share|improve this question

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
Thanks for your reply. Could you please let me know if the solution that I have identified is the right way to go? – Priyanka Oct 8 '12 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. – techtrekker Oct 8 '12 at 15:41
Thanks @techtrekker – Priyanka Oct 8 '12 at 15:45
@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? – Pramod Kumar Oct 9 '12 at 6:18
@PramodKumar, while you create a lookup field itself you will find it in the step 3 – Priyanka Oct 9 '12 at 6:50
show 2 more comments

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

share|improve this answer
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 Oct 8 '12 at 13:34
There is a field called ManagerId in User Object standard field one can use that write a small rule or trigger – Mohith Kumar Oct 8 '12 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? – Pramod Kumar Oct 9 '12 at 6:18

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.