Custom Recents

Special thanks to Subhadip Das from Capgemini who co-created this article.

Introduction

The Recent items feature in Pega Constellation UI allows users to access their most recently viewed cases or items, enhancing navigation and improving the overall user experience. By default, Pega maintains a list of the 15 most recently accessed items, including cases, rule instances, forms, landing pages, and other elements.

While the default Recent items implementation works well for many scenarios, there are situations where customization is needed to better meet specific business requirements. This article explains how to create a customized Recents list that gives you greater control over what items appear and how they are displayed.

Important note here is that we adding a new user friendly way to interact with Recents while still keeping default server side processing and data preparation logic untouched. This solution is upgrade friendly.

Below is what we will achieve through configuration described in this article. Landing page (can be also a widget on Home page) with Recents showing more details about last visited item improving user experience.

Before implementing a custom solution, consider how you can improve the default Recents panel staying with solution that is out of the box. By default, the panel shows the case ID and label. If pyLabel is not customized, it displays by default the case name, which is the same for all case instance, typically this is not what you want. A popular use case is to override it and display business-related case ID as the label so your users can immediately know which case they want to open.

This might be everything that you need, and no customization needed. If you want to proceed with creating custom solution please keep in mind one important benefit of standard solution. Default Recents panel is always available on menu for the user allowing quick access to recent cases, without switching context. While implementing your custom solution as widget or dedicated dashboard consider to keep the out of the box one still available for users.

### Why Customize the Recents List?

Customizing the Recents list allows you to:

  • Filter the types of cases or items that appear on a list
  • Add custom columns with additional information (by default you have only case id and label)
  • Define number if recent records that you want to present
  • Provide direct access to cases via clickable links along with ability to open preview panel
  • Integrate the list with other elements of your application - have it a as a widget or dedicated landing page

Technical Implementation

The following steps outline how to create a customized Recents list in your Pega Constellation application:

1. Create a Data Page on work pool class

The first step is to create a Data Page on your case work class:

  • Write a Data Page (list) on Case (work) class
  • Make this Data Page accessible via API so it can be referenced by other components - set status of Data Page to API

2. Configure Report Definition

For the Data Page, use a report definition as the source:

  • Set the source of the Data Page to a created report definition
  • Create a new report definition on the Case (work) class

3. Configure the Report Definition Join

A key configuration here is to use System-User-Activity class. This is the class in which Pega stores recents items. The key to making this work as a Recents list is joining the Case data with System-User-Activity:

  • In your report definition, configure a join with System-User-Activity
  • Use the following join condition: Recent.pxResourceKey = Work.pzInsKey
  • Add the order: Recent.pxUpdateDateTime DESC

4. DateTime Properties

There are two important DateTime properties to understand when working with a custom Recents list:

  • Recent.pxUpdateDateTime: This property reflects when a user interaction with an item in the Recents list occurred. It’s updated whenever a user adds an item to the list or interacts with it.

  • Case.pxUpdateDateTime: This property reflects when the actual case was updated. It’s updated whenever changes are made to the case content itself.

For a custom Recents list, the Recent.pxUpdateDateTime is more relevant as it tracks when users interacted with cases, not just when cases were modified. This is key for Recent functionality to work.

The descending (DESC) order is crucial because it ensures that the most recently accessed items appear at the top of the list, creating the expected user experience of seeing the newest interactions first.

5. Create a Landing Page

After setting up your Data Page with the report definition as its source:

  • Create a Landing Page with template set to List Page that refers to our Data Page

  • Configure the columns you want to display in this view

6. Apply “Display as Link to Object” on the Case ID Column

To make the Recents list interactive:

  • In your view configuration, locate the Case ID column
  • Apply the “Display as link to object” option to this column
  • This allows users to click on items in the Recents list to navigate directly to the cases

Constellation 101 Series

Enjoyed this article? See more similar articles in Constellation 101 series.

9 Likes

@Kamil JaneczekThanks a lot my dear friend! it’s well written!

Hi, thanks for the article. are we able to add few other properties to OOTB Recents along with case ID and Label?

@Subhadip Das Pleasure to work with such a innovative client.

Hi @Kamil_Janeczek

We do have similar requirement to display the cases which the user has opened and worked on it. But we should only display Cases which he worked but not opened and closed with out doing any action on it. Does the System-User-Activity class has any of these properties which will record the user actions or any other OOTB functionalities which you can suggest.

Hi, recent records are added once they are open. To achieve functionality you mention you would need to track last updated by and last update date time, might be complex to achieve it.

@Kamil_Janeczek Thanks for your in Detail Explanation on Custom Recents. I do have one requirement to remove the Recent Items from the Dashboard View. Tried with Enabling the Disable the recent items check box in the work portal Dashboard through channel and also updated the System-user-recent to 0 for the Access group but no luck. Even tried to updated the DSS pyMaxrecentrecords to 0 but no luck. Do we have any feasibility to remove the Recent Items from the Work Portal Dashboard ?

Your inputs are Appreciated.

Hi @DeexithB17624872

While configuring the portal (channel) from App Studio, you will find some checkboxes at the bottom: notification, recents.

Uncheck the recent checkbox.

Hi @Subhadip_Das Thanks for your Prompt response. As I mentioned in my Post … Yes, I tried that option too by checking/Unchecking those check boxes but no luck.

I tired same thing by disabling Universal Search check box option in the portal it worked, but when i did same thing with recent checkbox it is not working as expected. It is behaving weird with recent items.

Let me know if you have any other inputs.

Thanks

This should work fine. At least I haven’t seen issues with it. Try on other instance. Sometime there are some changes in config that seems unrelated, but they come in a way. Last option is ticket to support as this should work.

1 Like

@Kamil_Janeczek Yup even i thought same Kamil. pfa screen shot where i am enabling that check box. Yes i tried with different instances but no luck. Even i removed the System-User-Recents Access previlage for my operator id still i am seeing the Recents in the work portal. Yup i should create an SR for this and need to work with Pega.

But Thanks All for your inputs.