Question
6
Replies
8293
Views
Morgan Stanley
Posted: May 3, 2019
Last activity: August 31, 2020
Iterate and Remove pages from the same page list in data transform
Hi,
Can't i iterate through and remove pages from the same page list in a data transform .
Its not working as expected when i execute the above DT.
***Edited by Moderator Marissa to update General to Product; update Product details***
Hi Haria,
there should be a thread on this topic on the community already. But there's one other approach, which I really like and thus want to share:
1. Iterate over the list
2. Mark those pages You want to remove by setting pyDeletedObject to True
3. After iterating over the list, invoke R-U-F @Utilities.RemoveDeletedObjects(<PageList>)
The reason why your approach is not working for you is because while removing pages the list-internal iterator object can't cope with the list being changed.
Let me know whether that works for You.