What is the best way to delete embedded pages in a page list(mapped to a repeating grid) on conditional basis by clicking a button on the UI ?
My requirement is to delete embedded pages in a page list when a property in those embedded pages has certain value.
I tried the below methods
1. Used For each page in, when, remove actions in a data transform, the actions were able to removed the embedded page but at the end of each iteration the deleted embedded page got regenerated with null values for all property expect for pxobjclass property, reason being the actions are executing with the embedded page as the primary page for each iteration, so at end of iteration pega is trying to find that embedded page(primary page) which got deleted since it is not there it just creates one with null values expect for pxobjclass.
2. Tried the first step in an activity using For each embedded page, when, Page-delete combination, results were same as the first step, embedded page regenerated with null values for all properties in it expect for pxobjclass property.
3. This time using data transform i copied the required(the pages which are not going to be deleted)embedded pages to a temp page list, removed the source page list from clipboard using remove action, then copied the embedded pages from the temp page list to the source page list. again the pages got regenerated, they didn't get regenerated during the execution of data transform, but just before execution of an activity Work-Cover- Add, there is a step in the tracer called "Interaction begin" before the execution of that activity(Work-Cover- Add), if i open it i see something called "Query Data"(a property may be) which has the properties of the all embedded pages (both previously deleted and omitted), properties in omitted pages are having their respective values and properties in the previously deleted pages have null values.
(The reason for execution of Work-Cover- Add activity after the DT was that The DT execution was configured in an action set followed by action named "add new work" action)
**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.
I tried both steps (step 1 and step 2 described in the post), the page to be deleted remains as the primary page during the iteration and when it gets deleted pega tries to find the primary page since it is not there it creates a new embedded page with null values for all properties in it except for pxobjclass.
This is the 3rd step that i have mentioned in the description, the problem with this one is that page list (in which embedded pages are going to be deleted on a conditional basis) is mapped to a repeating grid on the UI, when i delete the pages (by copying the pages to temp list and copy back to source list) by executing a data transform on click of a button, the required embedded pages gets deleted successfully at the end of the data transform, but when it returns to UI it tries to find the missing rows in the repeating grid (the one to which the page list was mapped),Pega does not understand that these rows(embedded pages) got deleted so it recreates them (the properties inside these pages have null value).
This method works fine when the Page list is present on the UI where the deletion takes place.
below is a screenshot of tracer after the execution of the DT, the pyWorkPage does not contains the deleted embedded pages during the execution of activity SubmitModalFlowAction, but when i open the pyWorkPage during the execution of ReloadSection i can see the deleted embedded pages with its properties set to null value in it.
the pages are getting copied from the highlighted event (Interaction begin) in the below screenshot, it has all the properties of the embedded pages(both deleted and retained) under the some kind of page named Query data