Determining Data Entities
Here you’ll create the Distributor Application object in four steps:
After publishing the object definition, you can practice using the Distributor Application object to create entries.
Adding the Distributor Application Object
-
Open the Global Menu ( ), go to the Control Panel tab, and click Objects.
-
Click Add ( ).
-
Enter these details:
Field Value Label Distributor Application Plural Label Distributor Applications Object Name DistributorApplication
Storage Type Default -
Click Save.
This creates a draft object definition with these system fields:
createDate
creator
externalReferenceCode
id
modifiedDate
status
Configuring the Object
Object definitions include configuration options for modifying their general details, behavior, and available features. For example, you can determine how each object’s data is scoped, where users can access it in the UI, and whether to maintain a history of entry events.
Configure Distributor Application as follows:
-
Begin editing the object definition draft.
-
Change the definition’s ERC (External Reference Code). Consistent, human-readable ERCs can help you move object definitions between instances and reference them via APIs.
- Click Edit ().
- Replace the UUID with
C_DISTRIBUTOR_APPLICATION
. - Click Save.
-
In the Details tab, configure these settings:
Field Value Entry Display > Title Field ID Scope > Scope Company Scope > Panel Category Key Control Panel > Object Account Restriction > Active False Account Restriction > Account Restricted Field N/A Configuration > Show Widget True Configuration > Enable Categorization True Configuration > Enable Comments False Configuration > Enable Entry History False This configures the Distributor Application to store data by instance and appear in the Global Menu ( ) according to its panel category key (i.e., Control Panel → Objects). Additionally, users can add the object to site pages as a widget and assign tags and categories to Distributor Application entries.
-
Click Save.
Adding a Custom Field
Before you can publish an object definition, it must have at least one field.
-
Go to the Fields tab.
-
Click Add ( ).
-
Enter these values:
Field Value Label Applicant Name Field Name applicantName
Type Text Mandatory True Accept Unique Values Only False -
Click Save.
The new field appears in the Fields tab with the
Custom
badge.
Publishing the Distributor Application Object
When you publish custom objects, Liferay creates a database table for storing data entries. Publishing also registers the object with the OSGi framework, integrates it with Liferay’s core features (e.g., permissions, workflow, headless), and provides a basic user interface.
-
Go to the object’s Details tab.
-
Click Publish.
This activates Distributor Application and creates a database table with the applicantName
field along with the default system fields. See Publishing Object Drafts for more information on what happens during publishing.
Using Distributor Applications
Now that Distributor Application is published, you can begin using it:
-
Open the Global Menu ( ), go to the Control Panel tab, and click Distributor Applications.
-
Click Add ( ).
-
Enter an applicant name and click Save.
-
Return to the Distributor Applications page to verify successful entry creation.
Here entries appear in a table that includes the object’s custom field alongside the
id
,status
, andauthor
system fields. -
Click Actions () for the entry and select Delete.
-
Practice creating, updating, and removing entries before moving forward.
You can also use the REST APIs generated for Distributor Application during publishing to create, edit, query, and remove entries. These APIs are available at the c/distributorapplications
path. See Headless Framework Integration for a complete list of available APIs and Custom Object API Basics for an introductory tutorial.
Now that the object is defined, you can add more fields to collect the necessary applicant information.
Next: Adding Fields to the Distributor Application Object