Monday, June 13, 2022

Create Custom Fields Programmatically in Liferay DXP(7.3)

   

Today we will see how we can create custom fields in Liferay DXP . In this example we will create 3 custom fields one contain String value , second contain Boolean value and third contain drop down . We also set the permissions of Custom Fields in the same example. I am creating custom fields for sites . But you can use the same process for users and others entities of Liferay. Here i am using Liferay 7.3.

So lets start this step by step :-


Step 1:- Create a simple MVC Portlet

Create a simple Liferay module Project and provide the portlet name as CustomFieldsPortlet and paste this content:-


CustomFieldsPortlet.java


Explanation :

Here we create 3 custom fields in sites/Group.


Step 2:- Check Result

Before deployment go to create sites and create a dummy site . Then try to edit that site. Their is no Custom filed


Now lets deploy the portlet and check again.





Now For Checking Permission Go to Control Panel and Check Custom Fields of Group/Site.



Related Post:-



No comments:

Post a Comment

Total Pageviews

Number Of Unique Visitor

Free counters!