Question
Removing certain Pages in a PageList based on a condition
I am looping through Attachment Categories in a PEGA pyGetListOfAttachmentCategoriesWrapper Activity and I set .pyNote as shown below
my clipboard page is pyCategoryList.pxResults is as shown below
How can I remove all pyCategoryList.pxResults except for say CategoryList.pxResults(3) when a certain condition is met which I am checking as shown below?
I am using Page-Remove and pyCategoryList.pxResults(<CURRENT>) as shown above.
I am getting the following Indexing error on my tracer
' java.lang.IndexOutOfBoundsException: The Reference pyCategoryList.pxResults(4) is not valid.'
Any help would be appreciated.
***Edited by Moderator Marissa to update General to Product***
We can use RemoveDeletedObjects function to removed pages from the pagelist. In the above scenario, loop through the pagelist and set pyDeletedObject to true on pages that need to be removed, and then use the function to remove the required pages.
Please find the below screenshot for a sample implementation.