legacy-knowledge-base
Publicado Sep. 25, 2010

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

written-by

Aaron Wang

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

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.
did-this-article-resolve-your-issue

legacy-knowledge-base