Posted: 26 Feb 2018 14:07 EST Last activity: 16 Mar 2018 18:55 EDT
Get values from data page in the clipboard
I am working on an activity in which I need to pull values from a data page that has been loaded into the clipboard during the processing of a case. I've tried several ways to get it, such as tools.findPage("PAGE").getProperty("PROPERTY").getStringValue(), but nothing is being retrieved. How is the best way to go about this? The values are being used to set a property to be used in a Connect SQL rule. The property is building, but with blank values, so if I can get the data from the data page in there, the save to the database should work.
I did some experimenting and I have managed to get it to retrieve values, but it appears to be re-retrieving the data from the database instead of using what is already in memory. I declared a page, let's say D_SiteAddress in Pages&Classes in my activity of class Code-Pega-List, then declared D_SiteAddress.pxResults as the external mapping class that contains the data page, let's call it SiteAddress. When the activity runs, it is getting the values properly. I used a syntax such as D_SiteAddress.pxResults(1).ZIP_CODE and it retrieved it. However I entered a value in for ADDRESSLINE2 in the case, but that value did not come through, although I set that property to do a Post Value when it changed. So my question now is, how to I ensure that I am using the page that is already on the clipboard and not re-retrieving it? When I look at this page in the clipboard, the value I entered into the case does appear there.
With this process it will load the Page list into the clipboard from the database records without passing any parameter to it, so i don't think this is the right approach to load the existing page list(parameterized) from clipboard. May be we can try with some Java code to find this page list from clipboard instead of declaring it in pages and classes to reload it again.
But in the below link which my colleague had share i noticed "The system accepts either of the above syntaxes to reference a data page only in a field where the Expression Builder is enabled. For example, you cannot use the syntax in the findPage() PublicAPI method."
So i am thinking to figure out any approach to read the parameterized page list from clipboard using Java code.
I got it to work. I had to reference it by specifying the current parameter, which I did by using the property I stored that value in for the case. So using D_SiteAddress[.TempSiteID].pxResults(1).ZIP_CODE, it grabbed the current value that I'd entered.