272
Views
8
Comments
Solved
OFFSET Fetch for Aggregate
Application Type
Traditional Web
Service Studio Version
11.53.27 (Build 61662)

Hello, 

I want to be able to Fetch records from the database from where I left off based on an parameter that holds the value of the amount of records fetched .


Is it possible to do an OFFSET for an Aggregate without using an Advanced SQL Query?

If so what does this look like? 

I understand how to do an offset for an Advanced SQL but not simplified aggregate. 

by the way I am using a traditional web app


Your help is greatly appreciated.

2021-01-19 14-07-32
Tom Zhao
Solution

HI 

Afaik you need use Advance Sql to achieve this.

In TWA there is no StartIndex parameter in Aggerate, Beside using table and list_navagation that automatically apply this function.

Regards,

UserImage.jpg
Frankee Murphy

Might've found the answer HERE by Miguel Verdasca however, I do not see the Start Index Property in my properties tab of my aggregate. ( I can not provide my OML)

2023-08-28 07-00-10
Paulo Torres
Champion

Hello,

Yes you can do with aggregates.

UserImage.jpg
Frankee Murphy

Hello @Paulo Torres, unfortunately the start index is not located in the properties panel of the Aggregate because I am not using it in a table or list screen. 

Instead I am simply getting the records of an aggregate in a Server action for a an update to a lump sum amount of records. 

2023-08-28 07-00-10
Paulo Torres
Champion

Hello,

I didn't notice you are speaking about Traditional. My bad, sorry :)

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Frankee,

It's been a while since I did anything for traditional web, but I think there is no such thing as a StartIndex parameter.

There is a pagination mechanism available, through the Listnavigation RichWidget together with the Listnavigation actions.  This widget keeps track of the index to be used and makes sure the right set of data comes back, not sure if they do that by using an offset on the database or some postprocessing of the retrieved data.

My advice would be to drag an entity to a UI flow to let scaffolding make an example list screen for you, and study how the listnavigation widget works.

If this is not for a UI and you can't use listnavigation widget, and you really want to use an aggregate, i would suspect you'll need to retrieve a maxrecords of pagenumber times items per page, and then do a iteration copying only from offset onwards to a local or output list to get your 'page'.

Dorine

UserImage.jpg
Frankee Murphy

Hello @Dorine Boudry!


I will try this! Thank you .


Also yes there is no StartIndex parameter for an aggregate. 

2021-01-19 14-07-32
Tom Zhao
Solution

HI 

Afaik you need use Advance Sql to achieve this.

In TWA there is no StartIndex parameter in Aggerate, Beside using table and list_navagation that automatically apply this function.

Regards,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.