Fórum

6.2 GA4 - New User Expando Values not in table

thumbnail
William Gosse, modificado 8 Anos atrás.

6.2 GA4 - New User Expando Values not in table

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
I have a set of custom fields added to user and some have default values. I then created a new user programatically using the API. When I view my new user in the control panel everything looks good, including the default values I gave for the custom fields. However when I look for my user in in the expandovalue table my new user's data is not there. I had to save the user in the control panel to make the data would show up in the table. This not what I was expecting. Can some one tell what's going on? Where is the custom field data in the control panel coming from before I do the save?
thumbnail
Olaf Kock, modificado 8 Anos atrás.

RE: 6.2 GA4 - New User Expando Values not in table

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens Recentes
Just a guess: As long as the value is the default value (e.g. has never been set) it's fine not to have it in the database? When you just create a user through the API, no custom values are set (unless you explicitly do so), but the UI fetches the default value for the user's profile.

Save the data from the profile and this explicitly saves everything, including the custom fields - voila.

You shouldn't look at the database anyway... ;)
thumbnail
William Gosse, modificado 8 Anos atrás.

RE: 6.2 GA4 - New User Expando Values not in table (Resposta)

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
I fix this by programatically adding the custom field values with the expando API when I add the user. I think if there's custom fields associated with user they should be added to the expando values table automatically when a new user is created. Its some what misleading to see custom filed values associated in the control panel but to be able to access them with the API.. The only way I figured that out was by looking at the database.
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: 6.2 GA4 - New User Expando Values not in table

Liferay Legend Postagens: 14914 Data de Entrada: 02/09/06 Postagens Recentes
Yeah, but imagine a system with 5+ mil users most of which relying upon default values...

All of those records in expando table w/o any real need.

My guess is you only noticed this because you're looking directly into the DB and, as we all should know, we should never ever be doing this....
thumbnail
Samujjwal Sahu, modificado 8 Anos atrás.

RE: 6.2 GA4 - New User Expando Values not in table

Junior Member Postagens: 31 Data de Entrada: 22/05/12 Postagens Recentes
I am facing the similar thing for my 100s of sites. We have several custom fields associated with site. And we read the values of the custom fields from the theme. Now as and when we create a site the custom fields are not stored in the database tables with the default values. So I decided to use groovy script to add those custom fields related entries with default values into the database.
So needed your help, on how did you programatically added the custom fields into the database for a particular user?
I need to do the same thing for my site.

Is there a way to fetch all the site specific Custom fields name using some liferay API?

Any help is highly appreciated.

Thanks & Regards
Samujjwal (Sam)
thumbnail
Samujjwal Sahu, modificado 8 Anos atrás.

RE: 6.2 GA4 - New User Expando Values not in table

Junior Member Postagens: 31 Data de Entrada: 22/05/12 Postagens Recentes
Was able to resolve the issue. With expando API as mentioned above. the concerned db tables are ExplandoTable, ExpandoRow, ExpandoColumn and ExpandoValue. Each have their own LocalServiceUtil class respectively in liferay api. Using which one can add values for a particular custom field.
thumbnail
William Gosse, modificado 7 Anos atrás.

RE: 6.2 GA4 - New User Expando Values not in table

Liferay Master Postagens: 533 Data de Entrada: 04/07/10 Postagens Recentes
I'm sorry I missed your question about this thread. I did use the Expando API to do to it. If you still need help I can add the code that used as well.