Posted: 26 Feb 2019 20:07 EST Last activity: 17 Feb 2021 10:12 EST
Looping through DataPage D_pyWorkHistory using For Each Embedded Page
I need to log the pyMemo Property of a WO and for this I am looping through the DataPage D_pyWorkHistory and am trying to retrieve the pyMemo property for each of the pxResults. My clipboard is shown below.
For this, I am calling the 'For Each Embedded Page' in an activity as shown below and my step page is "D_pyWorkHistory.pxResults".
I am unable to access properties on the pxResults page and my tracer is showing the following for the above step.
Not sure why Tracer is showing the following
RDB operation returned result set with 0 rows
Q1.) As my results are already present on DataPage "D_pyWorkHistory" and I have "pxResults" page, why is my activity calling the SQL statement again?
Q2.) More importantly why is my result count zero, when I do have results on my D_pyWorkHistory Datapage for the WO.
Q3.) How do I access any property on the "D_pyWorkHistory.pxResults" page.
Thanks for providing the screen shots which are very helpful. I am now able to run my Activity and it is bringing back the results and the count of the pxResults ResultSet as shown in your code. However I am unable to access the properties on pxResults Page.
HOW can I use access an embedded property as I am looping through the D_pyWorkHistory[CaseInstanceKey:param.CaseKey].pxResults (within the clipboard structure that I have)?
Can you please provide with code how I can get the embedded property pxLatitude contained in the pxResults which is under D_pyWorkHistory?
Add a child to your looping step as shown below by right clicking on Loop.
This will create an inner step for the Loop. Since the StepPage is empty for this inner loop, it takes the context of the outer loop i.e D_pyWorkHistory[CaseInstanceKey:param.CaseKey].pxResults which is of type History-xxxxxx-Work.
When you hit the down arrow inside your Log Message, the History Property '.pxLatitude' should be available.