I have an ID of user(say 00536000002qYTUIU8), which is not necessarily current context user, and want to get that user's name in apex. I can do following to get this:
select name from User where id ='00536000002qYTUIU8'
But is there any way to avoid querying DB and get the name from any method, something like:
User.getUsername(ID)
UserInfo.getUserName
( don't remember the exact function from UserInfo) will return his name. Else I think it's the only wayUserUtility
class with a static methodgetUserName()
to do so