Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-43650

Unable to access custom fields in BaseModelListener onBeforeRemove

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Inactive
    • Affects Version/s: 6.2.0 CE GA1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Liferay Portal Community Edition 6.2.0 CE GA1 (Newton / Build 6200 / November 1, 2013)
      MySQL Server version: 5.6.12-log MySQL Community Server (GPL)

      Description

      We have a custom field in User model that stores an external system id for the user. We use this in onAfterCreate and onAfterUpdate methods in our UserModelListener which extends BaseModelListener<User> to update user information to the external system.
      The external id is fetched with ExpandoValueLocalServiceUtil like so:

      ExpandoValueLocalServiceUtil.getValue(model.getCompanyId(), ClassNameLocalServiceUtil.getClassNameId(User.class), ExpandoTableConstants.DEFAULT_TABLE_NAME, "externalSystemId", model.getUserId());
      

      This works just fine in the two methods described above. However, when we try to fetch the custom field in onBeforeUpdate, the util returns null.

        Attachments

          Activity

            People

            Assignee:
            michael.saechang Michael Saechang
            Reporter:
            jlatvata Jouni Latvatalo (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 39 weeks, 4 days ago

                Packages

                Version Package