Question
Cox Communications
US
Last activity: 12 Aug 2020 17:25 EDT
Unable to access value list property from HTML rule
I have an HTML rule that runs on the pyReportContentPage. It as the following loop:
<pega:forEach name=".pxResults">
<tr>
<td><pega:reference name="$this.pyID"/></td>
<td><pega:reference name="$this.pyLabel"/></td>
<td><pega:reference name="$this.pyStatusWork"/></td>
<td><pega:reference name="$this.pyTextValue(1)"/></td>
</tr>
</pega:forEach>
The reference <pega:reference name="$this.pyTextValue(1)"/> is throwing the following error during run time.
The reference 1 is not valid. Reason: invalid property name: '1'
Obviously, the rule engine is assuming that the refernce to the value list is incorrect. If I change in a random way byadding a suffix <pega:reference name="$this.pyTextValue(1).pyValue"/>, then the exception disappears but the data turns out to be blank in the Excel attachment that is generated from the above HTML rule.
Should I refer to the value list differently?
I have an HTML rule that runs on the pyReportContentPage. It as the following loop:
<pega:forEach name=".pxResults">
<tr>
<td><pega:reference name="$this.pyID"/></td>
<td><pega:reference name="$this.pyLabel"/></td>
<td><pega:reference name="$this.pyStatusWork"/></td>
<td><pega:reference name="$this.pyTextValue(1)"/></td>
</tr>
</pega:forEach>
The reference <pega:reference name="$this.pyTextValue(1)"/> is throwing the following error during run time.
The reference 1 is not valid. Reason: invalid property name: '1'
Obviously, the rule engine is assuming that the refernce to the value list is incorrect. If I change in a random way byadding a suffix <pega:reference name="$this.pyTextValue(1).pyValue"/>, then the exception disappears but the data turns out to be blank in the Excel attachment that is generated from the above HTML rule.
Should I refer to the value list differently?
- Navigate to a report definition.
- Filter out the results.
- Invoke the activity that calls the above HTML rule.
- Observe the tracer.
The reference 1 is not valid. Reason: invalid property name: '1'
Changed the reference to the following (notice the hard coding of the subscript in pxResults):
<td><pega:reference name="pyReportContentPage.pxResults(1).pyTextValue(1)"/></td>
It displayed the value in the first row in all rows. Obviously, we need a way to soft-code the subscript. Tried the following also:
<td><pega:reference name="pyReportContentPage.pxResults(<current>).pyTextValue(1)"/></td>
I got an error message while saving the HTML rule.
***Moderator Edit-Vidyaranjan: Updated SR details***