Adding Fields to Clarity's Distributor Management App
In this article, you’ll continue implementing Clarity’s distributor management app. This involves creating picklists and adding new business fields to the Distributor Application object. Finally, you’ll create a basic view for displaying distributor application entries.
Exercise: Adding Basic Fields
Here you’ll add additional basic fields to the Distributor Application object.
-
Open the Global Menu (
), go to the Control Panel tab, and click Objects. -
Go to the Distributor Management folder and select View in Model Builder.
-
For the Distributor Application object, click Add Field or Relationship, and select Add Field.
-
Enter these values and click Save.
Field Value Label Comments
Field Name comments
Type Long Text Enable Entry Translation No Mandatory No -
Repeat the above steps to add this field to the Distributor Application object.
Field Value Label Business License
Field Name businessLicense
Type Attachment Request Files Upload Directly from the User’s Computer Show Files in Documents and Media Yes Mandatory No -
Open a terminal window and go to this folder in the course workspace:
liferay-course-objects/client-extensions/liferay-clarity-batch-create-distributor-object-fields
. -
Run this command to deploy a batch client extension and add the remaining basic fields to Clarity’s distributor management app:
-
Verify the fields appear in the Distributor Application and Application Evaluation objects.
If the fields do not appear, ensure both objects have the correct ERC:Object ERC Distributor Application D4B8_DISTRIBUTOR_APPLICATION Application Evaluation D4B8_APPLICATION_EVALUATION
Together, these fields can help Clarity assess potential distributors.
Exercise: Creating Picklists
Here you’ll create several picklists for use in Clarity’s distributor management app.
-
Open the Global Menu (
), go to the Control Panel tab, and click Picklists. -
Click Add (
), enterProduct Types
for name, and click Save.
-
Begin editing the picklist.
-
Click Add (
) and add these items to the picklist:Name Key Eyeglasses
eyeglasses
Sunglasses
sunglasses
Contacts
contacts
Lenses
lenses
-
Edit each item and set their ERCs to these values:
External Reference Code PRODUCT_TYPE_EYEGLASSES
PRODUCT_TYPE_SUNGLASSES
PRODUCT_TYPE_CONTACTS
PRODUCT_TYPE_LENSES
-
Change the picklist’s ERC to
PRODUCT_TYPES
.
-
Click Save.
-
In your terminal window, go to this folder in the course workspace:
liferay-course-objects/client-extensions/liferay-clarity-batch-create-picklists
. -
Run this command to deploy the client extension and add the remaining picklists for Clarity’s distributor management app:
-
Verify the new picklists appear.
With these picklists in place, you can now add single select and multi-select fields with predefined options to Clarity’s distributor management app.
Exercise: Adding Picklist Fields
Here you’ll use the picklists you created in the previous exercise to add fields with predefined options to the Distributor Application object.
-
Open the Global Menu (
), go to the Control Panel tab, and click Objects. -
Go to the Distributor Management folder and select the Distributor Application object to begin editing it.
-
Go to the Fields tab and click Add (
). -
Enter these values and click Save.
Field Value Label Products of Interest
Field Name productsOfInterest
Type Multiselect Picklist Picklist Product Types Mandatory No
-
In your terminal window, go to this folder in the course workspace:
liferay-course-objects/client-extensions/liferay-clarity-batch-create-distributor-object-picklist-fields
. -
Run this command to deploy the client extension and add the remaining picklist fields to Clarity’s distributor management app:
-
Verify the picklist fields appear in the Distributor Application and Application Evaluation objects.
Great! Now Clarity’s distributor management app has all the necessary fields for capturing applicant data.
Exercise: Creating a Basic View
The Distributor Application object has expanded to include numerous fields, making the default display cumbersome and inefficient. Here you'll create a custom view to simplify the Distributor Application's table.
-
While editing the Distributor Application object, go to the Views tab.
-
Click Add (
). -
Enter the name
Basic View
and click Save.
-
Click the new view to begin editing it.
-
In the Basic Info tab, check Mark as Default.
-
Go to the View Builder tab and click Add Column.
-
Check the following fields and click Save.
-
ID
-
Applicant Name
-
Business Name
-
Create Date
-
Status
-
-
Click Save.
Great! Now distributor application entries will be displayed using the view you created. Basic views like this are best suited for testing and administration cases where user experience and site integration are not important.
Conclusion
Congratulations! You have improved Clarity’s distributor management app by adding several new fields, along with a basic view. Next, you’ll learn how you can add validations to ensure data integrity.
Capabilities
Product
Education
Contact Us