Get another property based on getActiveValue in RD

Hi,

Greetings. Hope you are all well! I am trying to get another property which is on the results of a Report Definition based on the current/Active Value, i have tried various syntaxes but none of them seems to work. Is there any way i can do this? I am writing a custom control which will be used in Report Definition. Any ideas, please do let me know!

pxResults(1).pyID = this is the active one which has a hyperlink in RD

pxResults(1).pzInsKey =this is hidden in RD but value is being populated in results.

i need to get pzInsKey based on Active Value

I am on Pega 8.7.0

Regards,
Bharat

@KOMARINA By active value, do you mean the current iteration of pxResults ?

@Byshu Hi, I have a RD with a column pyID (this is my ActiveValue, as my control will be against this column). In this control, I am trying to get pzInsKey, which is also another column in the same result (pxResults(1)) in the control which i am using against column pyID.

pxResults(1).pyID - CustomControl

pxResults(1).pzInsKey - I am trying to get the value of this in my above control

Regards,

Bharat

@KOMARINA

If i am understanding the requirement correctly then you need to get the current index of the current row first and then pass it in pxresults.

@KOMARINA Could you try this

<%
ClipboardPage primaryPg = tools.getPrimaryPage();
int idx = Integer.parseInt(tools.getParamValue(“index”));

String insKey = primaryPg.getProperty(“pxResults”).getStringValue(idx,“pzInsKey”); %> <%=insKey%>

@BhanuPrakash_G Hi, Greetings. I have tried this code snippet but i am not getting the Index which is available in the Parameter Page but when i do tools.getParamValue(“index”) and print the value it is blank. Any thoughts?

Regards,

Bharat

@KOMARINA Can you trace and find which parameter holds the current row index in the parameter page while executing the control . When I traced in my local environment the row index was available in the index parameter while the control was executing.

@BhanuPrakash_G This worked but i will also try the one-liner and update in here. Thank you for this.

Regards,

Bharat

@BhanuPrakash_G This is available under index only in Parameter Page but i cannot get that within the control

Regards,

Bharat

@KOMARINA If possible could you let us know the code of the control.

@BhanuPrakash_G Sure, this is the code

<%
String Key = "MOD-DEFSP-SSE-WORK "+ tools.getActiveValue();

ClipboardPage primaryPg = tools.getPrimaryPage();
int idx =1; //Integer.parseInt(tools.getParamValue(“index”));
String insKey = primaryPg.getProperty(“pxResults”).getStringValue(idx,“pzInsKey”);
oLog.infoForced(“InsKey is”,insKey);
%>

<pega:save name=“workKey” ref=“<%=Key%>” />

<%
tools.appendString(tools.getActiveValue());
%>

@KOMARINA Can you try this to get param value

int idx = Integer.parseInt(tools.getParameterPage().getString(“index”));

or

int idx= tools.getParameterPage().getAsInteger(“index”);

@KOMARINA Found an easier way of retrieving property of the current row/record.

String insKey = tools.getActive().getParentProperty().getStringValue(“pzInsKey”);