Get the Max number from a data table and assign it to a property
I need to get the Max number from a data table and assign it to a property. I used an Auto-complete control for the property and sourced it from a Report Definition. The Report Definition works fine. But the assigning doesn't happen.
It is executing 'pyGetWorkClasses' report definition using activity pxRetrieveReportData.
Page 'WorkClasses' passed as Param.pyPageName is results page. Results of report definition execution will be stored in 'WorkClasses' page. As shown below, you can iterate over the page to read the results.
Similarly, you can execute the report using pxRetrieveReportData and read the max value from results page.
I am not sure how max value will be stored in result page but you can give a try.
Well, I don't think you can use report definition directly in dropdown control to achieve this because for report definition + dropdown configuration, you can only use non-summarized columns as source.
Non-summarized columns will be present in the pxResults pages of the report definition result page, so they are directly visible from dropdown to use as source. Whereas summarized columns are present in a value list 'pySummaryValue' under pxResults(), so as per my understanding they will not be visible from dropdown.
1) Create a report definition with only max column
2) Use pxRetriveReportData activity to run it in a pre-acitivity
3) Set value of ResultPage.pxResults(1).pySummaryValue(1) to your property.