Hi Everyone,
I have a requirement where I need to sort the grid on page load based on Priority . Eg.we have Critical, high and low priority. Critical priority cases will come at the top followed by high and low. I have given priority in initial sorts. In addition to that I have to sort with latest id on page load. So I have given both id and priority column in initial sorts so that it will sort on page load. This is working for the grid when the data source is coming from record. So the latest critical cases will come at the top since we have provided both id and priority in initial sorts.
I have another grid where the data source is from process report. There I could able to provide only one initial sort(either id or priority). It is not working as expected when I provided two initial sorts(i.e Id and priority).
Is there a way to provide multiple initial sorts for the grid where the data source is from process report. I need to sort both the columns on page load. Please help me to achieve this
Thanks
Discussion posts and replies are publicly visible
Where do you got stuck?? You can use a!sortInfo() for sorting data on grid based on multiple columns.
Unknown said:There I could able to provide only one initial sort(either id or priority). It is not working as expected when I provided two initial sorts(i.e Id and priority).
It's Working for me
I am using a!sortinfo in initial sorts of the grid. But it is taking only one sort which we give first
Here c4 is id and c12 is priority. If I give c4 first it is getting sorted based on id. If c12 is given first it is getting sorted based on priority. But I need both. Here c4 is given first so it is sorted based on id.
Here the source is from process report
When c12 is given first we can see that it is sorted based on priority (i.e critical cases at top)
Sorry , I mislead you sort info is not applicable for Process reports
Then what is the other way to configure sorting for process report. I could able to configure for one field but couldn't able to for multiple fields.
I think Process reports take only one Sort Column(On Page Load). So we need to decide which sort is more important on Page load and load with it. Upon loading we can define sort on each column
Another way is there but it's gonna take effort. cast it into map or datasubset and using it , But i don't guarantee those drill down capabilities will come.
I think the Initial sort is working for one field only. This may be due to report configuration. The report configuration allows sorting using one field only.
As mentioned by venkat Avuluri , you can build your report by creating a custom dataset.
Like others have said, using a!queryProcessAnalytics can only use a single sort.
How much data do you have? If you have a small-ish number of values, it would be pretty easy to just query all the data and sort it after you query it. Here's an example:
a!localVariables( local!query: a!queryProcessAnalytics( report: cons!MY_TASKS_REPORT, query: a!query( pagingInfo: a!pagingInfo( startIndex: 1, batchSize: 1000 ) ) ), a!gridField( data: local!query.data, columns: { a!gridColumn( label: "Task Name", value: fv!row.c0 ), a!gridColumn( label: "Date Assigned", value: datetext(fv!row.c7, "yyyy-MM-dd h:mm:ss a") ) }, initialSorts: { a!sortInfo( field: "c0", ascending: true ), a!sortInfo( field: "c7" ) } ) )
Hi, we have large number of data from report and the values will be dynamically increasing going forward
Are you sure you need all the data at once? Could you either add static filters to limit the data, or even give dropdowns or something at the top of the page where the user could filter their data?
We have dropdown filters at the top of the grid to filter the data. But if no filters are applied the user will be able to see all the data.