Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Andrés Cerezo
passing values to hidden expando field
28. März 2011 23:36
Antwort

Andrés Cerezo

Rang: Junior Member

Nachrichten: 92

Eintrittsdatum: 11. November 2010

Neue Beiträge

Hello all, I have a hidden expando field and I need to pass a default value depending of a variable. Anyone knows how can I do it?

Thanks.
Udaya Ramakrishnan
RE: passing values to hidden expando field
26. Oktober 2011 21:09
Antwort

Udaya Ramakrishnan

Rang: Junior Member

Nachrichten: 67

Eintrittsdatum: 6. September 2011

Neue Beiträge

hi,

use the below code as a example:

try {
ExpandoBridge expandoBridge=user.getExpandoBridge();;
ExpandoValueLocalServiceUtil.addValue(
expandoBridge.getCompanyId(), expandoBridge.getClassName(),
ExpandoTableConstants.DEFAULT_TABLE_NAME, "ur_custom_field",
expandoBridge.getClassPK(), "default_value");
}
catch (Exception e) {
_log.error(e, e);
}


execute this lines while u adding. For example i have added this lines when a new user was added to LR
Let me know this is useful to u.......................

thanks,
Udaya.R

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!