Hello Guys
ScreenName is uniquely identify to user and we can use screenname as user tag name in liferay.
Here, two ways to get user by using screenname with companyId :
Step 1: Get user by using screenname in jsp(view.jsp) page in liferay portlet.
long companyID = themeDisplay.getCompanyId();
User user = UserLocalServiceUtil.getUserByScreenName(companyID, screenName);
String UserName = user.getFullName();
Step 2: Get user by using screenname in Prtlet class(Controller) in liferay portlet.
long companyID = PortalUtil.getCompanyId(request)
User user = UserLocalServiceUtil.getUserByScreenName(companyID, screenName);
String UserName = user.getFullName();
0 Comment(s)