Question


Accenture
AU
Last activity: 21 Feb 2023 20:39 EST
How To Update Properties in TOP Page?
I have an activity in class X that loops a page in the same class. Within this loop, there is another page loop that is in class Y. In this class Y loop, I call an activity in class Z. In this activity, I want to increment a value that is in class X and display this property in a section that is in class X.
I use property-set TOP.propertyX=TOP.propertyX+1.
I checked the tracer that the property is incremented however it's shown as blank in the section X. Did I miss anything? Hope this scenario that I explained clear.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 21 Feb 2023 20:39 EST


Intellativ
US
@alfin.putra TOP keyword may not work correctly in activities context. You may want to get reference to your top level page and then use it in the inner loops. You can try following steps for your usecase.
1. Declare a parameter of type page.
2. Declare this parameter page in Pages and Classes.
3. In the activity get reference to top level page and store in the parameter. Use it in the inner loop.
3.a Use this function to get page name of top level page.
@(Pega-ProCom:Default).PageName(@(Pega-RULES:Page).getTopLevelPage(myStepPage))
4. You can do operations on this parameter page reference such as Obj-Save.


Aaseya IT Services Ltd
SA
@alfin.putra Are you calling the Activity to set the property in flow action or the Action set of the section?
Also you need to the property only for display purpose?


Accenture
AU
@TummalapalliNarayana Activity is called in background process agent and yes property is only used to display a count


TETCO
SA
After changes on X class, save and if require do the commit.


Accenture
AU
@Poosala There is already save after this step and we're not trying to commit anything yet as we still need to update something in the loop outside this activity


Pegasystems Inc.
IN
@alfin.putra The reason why it is not reflecting is because it might have not been committed, where exactly are you calling this activity in which context ? based on the context we will have to see if the values need an explicit save/commit or not


Accenture
AU
@SrinidhiMPlease see the steps in the attachment. We already put a save step after propertyset the TOP property. Do I need to add another save step that is not in ChildCaseZ page?


Pegasystems Inc.
IN
@alfin.putra Hi, Can you please confirm if you have added the save on the top page seems like you have only added save in ChildCaseZ Page whereas you set the properties on TOP and also can you please let me know if the save or commit activity does obj-save? if yes then you have to add one for Top page as well
Updated: 15 Feb 2023 17:52 EST


Accenture
AU
@SrinidhiM Hi, I've tried to saveorcommit on TOP page but still the same, the property not showing up in the UI and yes saveorcommit does obj-save. I've also tried obj-save as well on TOP page but same results


Cognizant
IN
@alfin.putra Please try to save the TOP page,so all the data that you are setting on that page will be saved.


Accenture
AU
@GayatriPavuluri Hi, tried save on TOP page but still same results
Accepted Solution
Updated: 21 Feb 2023 20:39 EST


Intellativ
US
@alfin.putra TOP keyword may not work correctly in activities context. You may want to get reference to your top level page and then use it in the inner loops. You can try following steps for your usecase.
1. Declare a parameter of type page.
2. Declare this parameter page in Pages and Classes.
3. In the activity get reference to top level page and store in the parameter. Use it in the inner loop.
3.a Use this function to get page name of top level page.
@(Pega-ProCom:Default).PageName(@(Pega-RULES:Page).getTopLevelPage(myStepPage))
4. You can do operations on this parameter page reference such as Obj-Save.