Question
Accenture
GB
Last activity: 14 Jul 2022 13:22 EDT
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
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 14 Jul 2022 13:22 EDT
JPMC
IN
@KOMARINA Found an easier way of retrieving property of the current row/record.
String insKey = tools.getActive().getParentProperty().getStringValue("pzInsKey");
Accenture
GB
@Byshu_Ayyappaswamy 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
Blue Rose Technologies
NL
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.
JPMC
IN
@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%>
Accenture
GB
@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
Updated: 6 Jul 2022 6:51 EDT
JPMC
IN
@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.
Accenture
GB
@BhanuPrakash_G This is available under index only in Parameter Page but i cannot get that within the control
Regards,
Bharat
Accenture
GB
@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%>" /> <a href="javascript:openWorkByHandle('<%= Key %>');"> <% tools.appendString(tools.getActiveValue()); %> </a>
Updated: 6 Jul 2022 8:15 EDT
JPMC
IN
@KOMARINA Can you try this to get param value
int idx = Integer.parseInt(tools.getParameterPage().getString("index"));
or
int idx= tools.getParameterPage().getAsInteger("index");
Accepted Solution
Updated: 14 Jul 2022 13:22 EDT
JPMC
IN
@KOMARINA Found an easier way of retrieving property of the current row/record.
String insKey = tools.getActive().getParentProperty().getStringValue("pzInsKey");
-
Srinivas Bharat Komarina
Accenture
GB
@BhanuPrakash_G This worked but i will also try the one-liner and update in here. Thank you for this.
Regards,
Bharat