Issue
- Is there any way or SQL statement to retrieve the User account's creator?
Environment
- Liferay DXP 7.0
Resolution
There have two ways to retrieve the User account's creator.
-
The user account's creator can be retrieved by API.
-
- Use the UserLocalService* (doesn't check permissions) or UserService* (does checkj permissions) classes to get the User object/s.
- Once you have the User object you can call:
- getCreateDate(): to get the creation date for the user.
-
getContact(): to get the Contact record for the user. With this record you can call:
- getUserId(): to get the userId of the creator of the user.
- getUserName(): to get the userName of the creator of the user.
-
- The user account's creator is also available in the fields with the same name in the tables User_ and Contact_ in the database.