Question
Optum
US
Last activity: 1 May 2017 19:26 EDT
Out-of-bound exception when deleting 6th item
I am having the same issue. I am iterating through a Page-List, and removing items from the Page-List, based on a Precondition. Let's say I have 8 items, in the Page-List.
The first 3 records get removed from the PageList, correctly.
The next 2 remain, correctly.
When I get to the 6th item that should be deleted, I am getting the out-of-bound exception.
I believe it is because:
1. Pega is storing in memory the total count of the original PageList.
2. As items are being removed, the Pagelist "virtually" decreases. So, the PageList has decreased from say 8 to now 5.
3. However, Pega is still maintaining the original count of the PageList
4. Then, when I am ready to do the Page-Remove, Pega still thinks I'm at a higher index, using the original Pagelist count (before items started being deleted) However, since the Pagelist is now smaller, it can't find the index, and it is throwing error that the index is out of bound.
I don't know if this is correct thinking, or how to fix it?
***Updated by Moderator: Marissa - This post was branched off of this thread***