You need to sign in to do that
Don't have an account?
Shephali Swarnkar
How to get ID of different users
Hi All,
I know two ways to get the ID of USER
1.Using query : [select id from user] here we can get all IDs of users.
2.From URL we can the specific user's ID
here if we want to get user's detail we need supply that ID from UI an way(list, input box etc...) and then we will get the detail.
Question:i need to develop an apex class to let user see their task list and details for which i need user's ID. Is there any other way to get the user's ID without supplying anything from UI so that whenever any user login they can run this apex class and can get their task list detail.
I know two ways to get the ID of USER
1.Using query : [select id from user] here we can get all IDs of users.
2.From URL we can the specific user's ID
here if we want to get user's detail we need supply that ID from UI an way(list, input box etc...) and then we will get the detail.
Question:i need to develop an apex class to let user see their task list and details for which i need user's ID. Is there any other way to get the user's ID without supplying anything from UI so that whenever any user login they can run this apex class and can get their task list detail.
You can get the current user id like this:-
UserInfo.getUserId() which returns the user id of the current user.
Thanks.