Support Article

Function PropertyExists returns unexpected results (Step page)

SA-37053

Summary



The Pega-provided function PropertyExists produces false results when the property does not exist on the Step page.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create an activity that calls PropertyExists for a page list on any page except pyWorkPage or pyWorkPage.pxResults, for example, @PropertyExists("pyWorkPage.pxResults"').
  2. Observe that result of the function is false.
  3. Create the page pyWorkPage.pxResults(1)
  4. Re-run the activity calls PropertyExists for a page list on any page except pyWorkPage or pyWorkPage.pxResults, for example, @PropertyExists("pyWorkPage.pxResults").
  5. Observe that the value returned this time is true, even though no property named "pyWorkPage.pxResults" exists on the Step page.

Root Cause



This is expected behavior for which an explanation is provided.

Resolution



Here is the explanation for the reported behavior:
This is expected behavior. There is no issue as such with getIfPresent clipboard API or PropertyExists function. The reason for the ambiguity is that PropertyExists and PageExists functions do not mention how complex references of type A.B (where A is a page and B is a property) are handled in those functions. A.B will generally resolve the top-level page to A and try to get a property named B in A. When A.B is used, the top-level page becomes A, not the Step page from which the function is called.

Published April 25, 2017 - Updated April 28, 2017

Have a question? Get answers now.

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