Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

avoid hard coding pyWorkPage in activity

SA-1754

Summary



An Activity is used to retrieve customer data. The activity is working as expected but pyWorkPage has been hardcoded. This service request was a “how to” question really on how to parameterized the pyWorkPage.

Scenario:
1. An Activity has been created to retrieve customer data.
2. The pyWorkPage is currently hardcoded on the activity.
3. Said hardcoding isn’t ideal because the Work Object could be on any page and not only on pyWorkPage.



Error Messages



No specific error message


Steps to Reproduce



 
  1. Create an Activity with pyWorkPage hardcoded.

 
  1. Open a WorkObject on another page (not pyWorkPage)
  2. Activity will not be working as expected of course



Root Cause



This is the hardcoding effect, the page name has to be parameterized in order to avoid those type of unexpected behaviour.



Resolution



A local change has been provided in order to parameterized the working page:
 
  1. Use getStepPageName function to get the step page name

 
  1. The parameter need to be of type Page Name

 
  1. Then on the activity use the parameter not the pyWorkPage hardcode





 
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us