FavoriteDeveloper Forums User (Inactive) (Salesforce Developer Forums) asked in #ApexAug 7, 2008, 3:03 PMHow to get the current User ID in a Apex classHow can I get the current Salesforce User ID in an Apex class?Any help is appreciated!Chris7 answersSortSort by DateSort by Most HelpfulSort by DateLoad more comments...Accepted AnswerSrini P (Testit)Aug 7, 2008, 3:16 PMYou can get the current user id like this.UserInfo.getUserId() which returns the user id of the current user.Add a commentWrite an answer...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Accepted AnswerSrini P (Testit)Aug 7, 2008, 3:16 PMYou can get the current user id like this.UserInfo.getUserId() which returns the user id of the current user.