Skip to content

Instantly share code, notes, and snippets.

@nshaw
Created October 5, 2012 16:42
Show Gist options
  • Select an option

  • Save nshaw/3840907 to your computer and use it in GitHub Desktop.

Select an option

Save nshaw/3840907 to your computer and use it in GitHub Desktop.
Find User By Email
import com.liferay.portal.service.UserLocalServiceUtil
import com.liferay.portal.util.PortalUtil
import com.liferay.portal.model.User
try {
long companyId = PortalUtil.getDefaultCompanyId()
String email = "nathan.shaw@liferay.com"
User user = UserLocalServiceUtil.getUserByEmailAddress(companyId, email)
println user
}
catch (Exception e) {
println ("Script failed" + e)
}
@ilyes555
Copy link

ilyes555 commented May 5, 2024

@Vishnu-git-space
Copy link

@AhmedAhmedAnter
Copy link

@anini71012-crypto
Copy link

@Ankashram-Git
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment