Wednesday, 8 May 2019

Refresh section using ReloadSection activity in Pega

Refresh section using ReloadSection activity in Pega


I faced one scenario to reload section using activity in my work. I will explain how to refresh section using activity.

ReloadSection in class Name @baseclass is the pega activity which will call during section refresh, We have to pass some needed parameter to this activity to execute this activity. Some needed parameters are 
  • StreamName - Section name to refresh
  • StreamClass -  Class Name of the Stream. If the rule we are refreshing is section then class will be Rule-HTML-Section, if the rule we are refreshing is HTML Fragment then class will be Rule-HTML-Fragment. 
Below is the section that we are gonna refresh when CustName property value is changed.

I Created a Declare On Change rule to monitor CustName , If this property has Changes then it will trigger the activity"CalculateCustDetails"
Below is the activity that will execute on CustName property changes.

In First step I added a Property set to setting parameter that we have to pass to ReloadSection activity.

In Stream Name parameter provided the section name 
In Stream Class parameter provided the Section Class(Rule-Obj-Section)

We can pass extra parameter like pre activity to execute before section reload for this activity.

So If I am provide any name in the CustName property dynamically it will change the name to Rahul(HardCoded Name in above acitivity) and it will refresh the section. Lets try it.

I am providing the name chaitanya . On ReloadSection activity execute it will change the name to Rahul Lets try it.


After section refresh,


That's it. Hope you understand this post. If any doubt ask in Comment 😊

Note: If we are providing StreamName as section class name then it reload section will through below error.

* Missing stream key property pyID *

1 comment:

  1. what if the activity which we calling the reloadsection is in different class and section which needs refresh is in different class

    ReplyDelete