Accessing to Objects custom fields in an Aplication Diplay Template


  • I'm configuring a search results ADT for a custom Object. By default I can choose, in the available variables, the title, author, etc. But I need to access custom fields of the Object as well.


  • Liferay DXP 7.4


  • Search for the service endpoint in the API console ( /o/api ) on a web browser corresponding to the Object entity.
  • In the ADT make a call to the rest service using the "restClient" and the classPK as Id.
<#if entries?has_content>
<#list entries as entry>
<#assign myobject = restClient.get("/c/myobjects/${entry.getClassPK()}")>
field1: ${myobject.field1} <br>
field2: ${myobject.field2} <br>
field3: ${myobject.field3} <br>


Additional Information

  • Here is a recorded session with a live demo by Alejandro Tardín that explain perfectly how to implement this solution:



1 人中有 0 人觉得有帮助