cancel
Showing results for 
Search instead for 
Did you mean: 

Getting last page in pagination

mittalabhi86
Champ in-the-making
Champ in-the-making
Hi Team,

We are looking for a way to identify the last page, when fetching the data using listPage. Having said that, we would also like to a link for first and last page in our UI, which means that we can also fetch the last page directly, skipping all pages in between.

Is there a way we can achieve this currently?
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,
You mean first/last page for e.g process tasks right?
You can count the tasks in the query and based on the count you can get pages volume.

Regards
Martin

mittalabhi86
Champ in-the-making
Champ in-the-making
Hello Martin,

Does that mean I will have to make a separate query for count() to get total number of records? And then maintain this count across requests?

Regards
Abhishek

jbarrez
Star Contributor
Star Contributor
Yes. There is no magic way to know what the last page is.