How to display all records of aggregate in list record

Hi All,


I have a record with 107 data. I need to display them all without paging, so I set the variable of table record as:

Line Count = Source.length

Start Index = 0



But this way, the table will only displays 51 items


But if I set the Line Count with some number, for example 200, the table will display the correct number of data.

is this a bug?


Thanks,
Daniel

Solution

Hello Daniel,

Use LineCount = 0

But I have to say this is not good practice.

Cheers.

P.S. The LineCount is used BEFORE the source is executed, to tell the aggregate how many lines to fetch, than it will use the default value of 50.

Solution

Hi Daniel,


Is not a bug because the aggregate will not return all the values when used in a Table Records with pagination.


You can overcome this by counting the number of total records in a separate Aggregate or by using a plain Table Record.


Please find an example attached.


Cheers,

Renato




Daniel Prasetya Nugroho wrote:

Hi All,


I have a record with 107 data. I need to display them all without paging, so I set the variable of table record as:

Line Count = Source.length

Start Index = 0



But this way, the table will only displays 51 items


But if I set the Line Count with some number, for example 200, the table will display the correct number of data.

is this a bug?


Thanks,
Daniel



Eduardo Jauch wrote:

Hello Daniel,

Use LineCount = 0

But I have to say this is not good practice.

Cheers.

P.S. The LineCount is used BEFORE the source is executed, to tell the aggregate how many lines to fetch, than it will use the default value of 50.


That's good to know! Thanks a lot!

Hi Renato,


thank you for your reply.

Actually I have removed all the pagination stuff (the start index is set as 0), (Maybe I'm missing something)


I keep the line count webblock though.


I have tried to remove the line count webblock, but it gave me the same result (51 records only)

The aggregate is also a simple aggregate without any paging


Am I missing something here? do I need to remove something else?


THanks,
Daniel

Hi,

Did you tried set the Line Count of the Table/List records in the page to 0?

Cheers

I have tried Talbe Records Line Count: 0, but not displayed all data.(both OutSystems 10 and 11)

So, I think the post marked as Solution is not correct, and there is not smart solution to solve.

Hi Katajun,

At the time of the solution, that worked.
But the platform changed the behaviour after that. Now, if you put anything lower than 1, it'll fetch 50 records.

I think the workaround is to use a separated aggregate to count the number of records and set the LineCount of the TableRecords to this number. Or just set a very high number...

Cheers.

Hi Eduardo, thank you for your reply.

At the time of the solution, that worked.
But the platform changed the behaviour after that. Now, if you put anything lower than 1, it'll fetch 50 records.

Understood. I apologize for having judged it as an wrong.
I think that it is a bug in OutSystems that is not backwards compatible if the setting is the same and the behavior changed. 

If this is a specification, OutSystems should open the optimizer's specification or mention in side effects and breaking changes or appear warn in ServiceStudio when setting a dynamic value to LineCount, I think.


Thanks,

KataJun

Hi Katajun, 

No need to apologies :)

I got a bit surprise also, when we find out about this change, and I really don't know when it kicked in, and maybe this was in a breaking change (and I just don't remember).

In any case, to show all records is usually bad practice. If the number of records is too big, the user will not be able to work on them all, and search+pagination is a best approach.

If the reason is to make a report (for printing), than yes, it is a problem. In this case, use actually need a workaround like the one above.

Cheers.

I can't recall the "0" ever working, but my memory isn't that good so perhaps I'm mistaken :). We usually just set the count to a to a very high number, like 1,000,000 or so, if we do not need pagination (e.g. in a refresh query used for exporting to Excel).