How to access index of pagelist where the sub-pages are being deleted during processing
Scenario is as given below:
1. I have an activity A which has a Code-Pega-List called Page containing sub-pages as Page.pxResults(). Say the pagelist has 10 sub-pages.
2. I call activity B from activity A and loop through Page.pxResults() on the step page for each iteration of activity B
3. During the processing of activity B, I am conditionally deleting the current sub-page within scope - hence I may delete Page.pxResults(1) if some conditions are satisfied. In this case the earlier Page.pxResults(2) automatically becomes Page.pxResults(1) and so on.
The issue is that once I delete Page.pxResults(1) and PEGA automatically makes Page.pxResults(2) as Page.pxResults(1) and the next iteration begins, PEGA still refers to Page.pxResults(2) which was earlier Page.pxResults(3). The issue as you can observe is that PEGA has skipped the old Page.pxResults(2) which after page-delete is Page.pxResults(1).
I have also noticed that param.pyForEachCount continues to increase (which is fine) but I could not find any method/param which would exclusively refer to the index of the current iteration scope.
Has anybody else encountered this issue? My whole issue is around the fact that there is no way I can refer to the current scope of iteration (as param.pyForEachCount keeps increasing even if there is a sub-page delete and PEGA automatically re-indexes the sub-pages to start from 1).
I know that programatically this is not a challenge as there are other ways to keep a handle of the current context of iteration but I was hoping there would be a param/method which would just give us the current context of iteration.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Keep up to date on this post and subscribe to comments
- Index of parent page list incase of pagelist inside a page list
- Function or an activity to append page to a pagelist at a specified index
- Clipboard- Make pyWorkPage the default page (if it exists on the thread). Single-click a page name to expand the subpages
- Declare Index Not working- Deleting data embedded page from WO
- delete page from a pagelist