Copy Data from one pagelist to another pagelist using Loop
I'm trying to iterate through a pagelist (MyList.ThisList()), where ThisList can have multiple pages, but has a minimum of 1. I use Page-Copy in an activity and want to copy it. CopyFrom is: MyList.ThisList(<CURRENT>) and I want it to copy the page if it exists so it looks like this in the end:
MyList.ThisList(1) copy into NewList(1)
MyList.ThisList(2) copy into NewList(2)
Loop condition is "For each embedded page".
How does the activity create a new entry for each entry in ThisList?
Are you copying from MyList.ThisList(1) to NewList(1)? Its better to define NewList.pxResults in pages and classes tab with Code-Pega-List as class. When the activity runs, if ThisList has any embedded pages in it, it will be copied to NewList. There will be a separate pagelist created with a name NewList in clipboard with NewList.pxRrsults(Index) containing the copied pages.
Thanks for your reply. This does not solve the problem. I need ThisList(1) to be copied to the level MyList.ThisList to have it available to test it for example in a when-rule which is at the level MyList.ThisList. If that makes sense?
I just realised I might have described the problem incorrectly.
We have a class MyList which is top-level and contains the property ThisListS (which is a pagelist property). I now want to copy ThisListS to another class, called ThisList using a page called NewList.
Its little confusing with your requirement, but if i understand correctly you want to copy the Page list property content across different classes. Let's say you have SourceList page list property in ClassA and you want to copy the content of this page list property into DestinationList page list property available in ClassB, then please go through my use case which has been created to demonstrate the above requirement.
Hope that's what you're looking for, if not do let me know your exact requirement to help your further.
that's exactly what I want to do. And I believe your use case pretty closely matches my requirements. However, when following it and running the activity, it results in a time out at some point. Due to client requirements, SourceList is defined as manual.
Another solution I was thinking of was instead of copying the pageList into a new PageList, to copy it as a new page. So SourceList(1) in Class A will be DestinationPage1 in Class B
However, when following it and running the activity, it results in a time out at some point. -> Is your data huge? because i don't think you should get the timeout while copying the data from one source page list to destination page list.
Due to client requirements, SourceList is defined as manual. -> Need to understand how you are sourcing the data to Source page list property if you define it as Manual and also the page list content is available during the time of copying from source to destination?
So SourceList(1) in Class A will be DestinationPage1 in Class B -> I dint understand what you are trying to achieve, SourceList(1) is the first page available in the SourceList property and where are you storing the DestinationPage1 in Class B?