Is it possible to add Extra Fields Under Create User in Liferay

前端 未结 5 698
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 13:06

I am using Liferay 6 for portal Development . During Creating Users under Liferay , i need to add some extra Fields also ?? Please let me know if this is ppossible or not ??

5条回答
  •  执念已碎
    2020-12-29 13:40

    Just in case somebody try to retrieve the values from the custom fields and is having problems with null values returned by the method user.getExpandoBridge().getAttribute("yourCustomFieldKey") (even when you followed the threads about permissions), I found other way to retrieve the Custom Fields values:

    ExpandoTable table = ExpandoTableLocalServiceUtil.getDefaultTable(user.getCompanyId(), User.class.getName() );
    ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(table.getTableId(), "yourCustomFieldKey");
    ExpandoValue expandoValue = ExpandoValueLocalServiceUtil.getValue(table.getTableId(), column.getColumnId(), user.getUserId());
    

    Then you can do a simple (if the field is text) expandoValue.getString();

    Not so pretty, but do the work.

提交回复
热议问题