You need to sign in to do that
Don't have an account?

Pls help in querying the user object.
Hi All!
My requirement is
Consider senior level manager is logging in and he wants to see the users under him and other users under his user.
userList1 = [ select id, name, firstname, lastname,ManagerId from user where Managerid =: Userinfo.getUserId() ];
userList2 = [ select id, name, firstname, lastname,ManagerId from user where Managerid IN : userList1 ];
userList3 = [ select id, name, firstname, lastname,ManagerId from user where Managerid IN : userList2 ];
userList.addAll(userList1);
userList.addAll(userList2);
userList.addAll(userList3);
return userList;
this is wat i did and finally added the both the list to a single list.
apex:outputPanel id="chartPanel" layout="block">
<script type='text/javascript'>
google.load('visualization', '1', {packages:['orgchart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('string', 'Manager');
<apex:repeat value="{!userList}" var="u">
data.addRow([{v:'{!u.id}'
, f:'{!JSENCODE(u.roleBody)}'}
, '{!u.ManagerId}']);
</apex:repeat>
</apex:outputpanel>
But i want to get all users i.e., user uunder a user under another user. in a single query. How to get this?