Foren
Is it possible to add extra columns in a default liferay table?
Arunjyoti Banik, geändert vor 9 Jahren.
Is it possible to add extra columns in a default liferay table?
Junior Member Beiträge: 74 Beitrittsdatum: 26.08.14 Neueste Beiträge
I know by service builder I can add an entire custom table but is it possible to add extra columns in a default liferay table?
if yes, how? any documentation I can read will be very helpful.
if yes, how? any documentation I can read will be very helpful.
Jeffrey Paul Handa, geändert vor 9 Jahren.
RE: Is it possible to add extra columns in a default liferay table?
Liferay Master Beiträge: 541 Beitrittsdatum: 01.12.08 Neueste Beiträge
Hi Arunjyoti,
If you're looking to extend a Liferay defined entity, take a look at Custom Fields (Expandos). They allow you to easily add new data to an existing Liferay defined entity without modifying the database.
https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/custom-fields-liferay-portal-6-2-user-guide-17-en
If you're looking to extend a Liferay defined entity, take a look at Custom Fields (Expandos). They allow you to easily add new data to an existing Liferay defined entity without modifying the database.
https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/custom-fields-liferay-portal-6-2-user-guide-17-en
Arunjyoti Banik, geändert vor 9 Jahren.
RE: Is it possible to add extra columns in a default liferay table?
Junior Member Beiträge: 74 Beitrittsdatum: 26.08.14 Neueste Beiträge
Thanks Paul.
I knew expandotable are the easiest way for this but I just wanted to know whether it can be done. Because I cant figure out what is this dynamicquery used for.
I knew expandotable are the easiest way for this but I just wanted to know whether it can be done. Because I cant figure out what is this dynamicquery used for.
Jeffrey Paul Handa, geändert vor 9 Jahren.
RE: Is it possible to add extra columns in a default liferay table?
Liferay Master Beiträge: 541 Beitrittsdatum: 01.12.08 Neueste BeiträgeArunjyoti Banik:
Because I cant figure out what is this dynamicquery used for.
There is a Liferay Developer Network article that discusses Liferay's DynamicQuery API.
Arunjyoti Banik, geändert vor 9 Jahren.
RE: Is it possible to add extra columns in a default liferay table?
Junior Member Beiträge: 74 Beitrittsdatum: 26.08.14 Neueste Beiträge
And Sorry I forgot to mention, I want to create custom field for PasswordPolicy table but I cant find PasswordPolicy as resource for creating custom fields. Can you help please.
Jeffrey Paul Handa, geändert vor 9 Jahren.
RE: Is it possible to add extra columns in a default liferay table?
Liferay Master Beiträge: 541 Beitrittsdatum: 01.12.08 Neueste Beiträge
Ah, in that case you would need to extend the Liferay service (table), but to do that you'd actually create a second service that references the first. This used to be the approach before Expandos. This wiki article should still be relevant: https://www.liferay.com/community/wiki/-/wiki/Main/Extend+Liferay+Tables
Never modify any Liferay tables directly. It will definitely cause problems in the future.
Never modify any Liferay tables directly. It will definitely cause problems in the future.
Arunjyoti Banik, geändert vor 9 Jahren.
RE: Is it possible to add extra columns in a default liferay table?
Junior Member Beiträge: 74 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hiii Jeffrey,
Sorry for replying 2 months later. I did it as you said with expandos, I just created them programmatically. As a matter of fact, I realised any object for which getExpandoBridge() method comes, we can create custom field for that resource.
Thanks again for your help
Arun
Sorry for replying 2 months later. I did it as you said with expandos, I just created them programmatically. As a matter of fact, I realised any object for which getExpandoBridge() method comes, we can create custom field for that resource.
Thanks again for your help
Arun