Symptoms
In your application UI, when you have designed the action Open Work By Handle (activity doUIAction) as OnClick, a different case than the intended case might open in the grid layout. When the wrong case opens, this results in a confusing user experience where the user might start interacting with the wrong case.
You see this problem when grids are designed with read-only Data Pages that get removed from the clipboard during passivation after the page is left idle for some time. Upon reactivation of the requestor and attempting to open a record from the UI, the Data Page reloads with the latest data. If any updates occurred on the records after passivation and the order of the index in the Data Page differs from the UI, then this issue occurs.
Explanation
The root cause of this problem lies in the interaction between the read-only Data Pages and the data refresh during reactivation. When the read-only Data Pages are removed from the Pega Clipboard during passivation and subsequent reactivation triggers Data Page reload, any changes in the record order can lead to opening the incorrect case.
Environments
The problem was reported in the following environments:
- Pega Platform™ version 8.3.2 on-premises environment
- Pega Platform version 8.5.3 in Pega Cloud® services 2.20.8
Solution
To address this issue, use the following solution:
Introduce a hidden field on the grid row that is mapped to the property generating the key, pzInsKey.
By including this property as part of the Document Object Model (DOM) when clicking to open the work object, the event infrastructure will use this hidden property's key instead of the change tracker map.
With this approach, the work object clicked on the row will always be opened because the new values in the change tracker will not be considered.
Perform the following steps to implement the workaround for ensuring that the correct case is consistently opened when users select a record from the grid.
- Identify the property responsible for generating the key for the work objects.
- Configure a hidden field within the grid row, associating it with the identified property.
- Place the hidden field configuration in a column and source it with a section reference.
- Include the hidden field in the referenced section.
- After adding the Section reference, specify the Column Properties:
- In the Filtering field, select Range/Search.
- Select the checkbox Enable sorting.
- In the field Visibility on table, select Initially visible & user will be able to hide it.
This workaround ensures that the property is an active visible property in the UI. Otherwise, Filtering and Sorting will not behave as intended.
Related content
Action category: Get Work (for Pega Platform version 8.5 and later versions
Supported actions and limitations in AJAX containers
openWorkByHandle(workID, className, options)
Obj-Open-By-Handle method (for Pega Platform 8.5 System Administration)
Obj-Open-By-Handle method (for Pega Platform 8.6 Reference)
Harness and Section forms: Help — Client Event Editor (for Pega Platform 8.8)
Harness and Section forms: Help -- Client Event Editor (for Pega Platform 8.5)