Foros de discusión

Deleting Expando fields programmatically.

thumbnail
Tanweer Ahmed ., modificado hace 1 año.

Deleting Expando fields programmatically.

Expert Mensajes: 322 Fecha de incorporación: 11/03/10 Mensajes recientes
Hello,
I have a list of users, each having a set of expandos(custom fields).Can I delete these expandos based on the userId.That means I want to delete the custom fields only for few of the users whose userId I know.

Any Suggestions.Thanks in advance.

Hope this helps,
Regards,
Tanweer
mPowerian-BoschLer
thumbnail
Ali Shahrami, modificado hace 12 años.

RE: Deleting Expando fields programmatically.

Junior Member Mensajes: 52 Fecha de incorporación: 1/08/09 Mensajes recientes
Tanweer,

You can delete Expando value using one of the following methods:


ExpandoValueLocalServiceUtil.deleteValues(classNameId, classPK);
ExpandoValueLocalServiceUtil.deleteValues(className, classPK)
ExpandoValueLocalServiceUtil.deleteValue(classNameId, tableName, columnName, classPK)

You can get "classNameId" and/or "className" from ClassName_ table. classPK is the same as userId.

Ali
thumbnail
Tanweer Ahmed ., modificado hace 1 año.

RE: Deleting Expando fields programmatically.

Expert Mensajes: 322 Fecha de incorporación: 11/03/10 Mensajes recientes
Ali Shahrami:
Tanweer,

You can delete Expando value using one of the following methods:


ExpandoValueLocalServiceUtil.deleteValues(classNameId, classPK);
ExpandoValueLocalServiceUtil.deleteValues(className, classPK)
ExpandoValueLocalServiceUtil.deleteValue(classNameId, tableName, columnName, classPK)

You can get "classNameId" and/or "className" from ClassName_ table. classPK is the same as userId.

Ali


Hi Ali,
Thanks for the response. This code will only delete the values for the custom field.I was actually looking to delete the custom field itself based on the userId.

Regards,
Tanweer
mPowerian-BoschLer