Is there any way to retrieve the User account's creator

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.
这篇文章有帮助吗?
0 人中有 0 人觉得有帮助