Liferay Developer Certification Practice Exam 2026 – All-in-One Guide to Master Your Certification!

Session length

1 / 20

What method should be used to get the value of a custom field for a User object named "user"?

ExpandoLocalServiceUtil.getAttribute(user)

user.getExpandoBridge().getAttribute()

To retrieve the value of a custom field from a User object in Liferay, using the method provided in the selected answer is appropriate because it utilizes the ExpandoBridge associated with the User object. The ExpandoBridge allows access to dynamic fields—those that are not hard-coded in the database schema but rather stored as custom attributes.

By calling `user.getExpandoBridge().getAttribute()`, you are specifically referencing the ExpandoBridge tied to the User, which manages the custom fields. This method is designed to fetch the value of a specific custom field based on the field name provided as an argument, ensuring that it looks into the correct structure that holds these custom attributes.

Other choices do not effectively target the necessary approach for the context of retrieving custom fields. For instance, using ExpandoLocalServiceUtil requires the specification of the custom field and might involve additional parameters like company ID or class type, making it less straightforward for this specific task. The `user.getExpando()` method provides access to the Expando object itself, but lacks the functionality to directly fetch attribute values. Lastly, the PortalUtil class generally serves as a utility for various portal-related tasks rather than specifically managing custom fields for User objects.

Thus, the chosen method correctly fits the

user.getExpando()

PortalUtil.getExpando(user)

Next question

Find the option that is right for you!

All options are one-time payments.

$12.50

30 day premium pass

All the basics to get you started

  • Ad-free experience
  • View your previous attempt history
  • Mobile app access
  • In-depth explanations
  • 30 day premium pass access
👑$30.00 $87.50 usd

6 month DELUXE pass (most popular)

Everything with the 30 day premium pass FOR 6 MONTHS! & the ultimate digital PDF study guide (BONUS)

  • Everything included in the premium pass
  • $87.50 usd value for $30.00! You save $57.50!
  • + Access to the ultimate digital PDF study guide
  • + 6 months of premium pass access
  • + Priority support
$12.50 $18.99

Ultimate digital PDF study guide

For those that prefer a more traditional form of learning

  • Available for instant download
  • Available offline
  • Hundreds of practice multiple choice questions
  • Comprehensive content
  • Detailed explanations
Image Description
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy