Fetching part of data from database.

Fetching part of data from database.

  

Instead of fetching data from outsystem database,how can we fetch only part of the data from outsystem database?? and onclick of next button it should fetch next set of data somewhat like pagination but it should fetch from database not from preparation!!

Hi Ronan,

You fetch data from the database every time you use an Aggregate or the SQL tool... can you explain in more detail what is it you are trying to achieve? From your explanation above it does seem to be exactly like how pagination is usually implemented in OutSystems.

Hi Ronan,

Implement pagination with aggregate is right option in your case.

Thanks!

Jorge Martins wrote:

Hi Ronan,

You fetch data from the database every time you use an Aggregate or the SQL tool... can you explain in more detail what is it you are trying to achieve? From your explanation above it does seem to be exactly like how pagination is usually implemented in OutSystems.

Hi Jorge,

I need to fetch the data from databases on click of next button in pagination not from the aggregate which as already the fetched data.


Hi Ronan T,

If you don't want to use the outsystem pagination, then you can create your own.

To Achieve this follow the below steps-

1- Create a link buttons just like pagination.

2- Create a action to fetch the set of data.write a query inside this action then refresh the list record table.

3:- Get the start row number and end row number by using the page number and record per page

4- Pass the start row number and end row number in the query

5- Using start row and end row number fetch the data from the database.

6-Assign this action to the destination of the links.


I will suggest you to use this pagination if you have huge volume of data.


Thanks

Rajendra Singh



Raj wrote:

Hi Ronan T,

If you don't want to use the outsystem pagination, then you can create your own.

To Achieve this follow the below steps-

1- Create a link buttons just like pagination.

2- Create a action to fetch the set of data.write a query inside this action then refresh the list record table.

3:- Get the start row number and end row number by using the page number and record per page

4- Pass the start row number and end row number in the query

5- Using start row and end row number fetch the data from the database.

6-Assign this action to the destination of the links.


I will suggest you to use this pagination if you have huge volume of data.


Thanks

Rajendra Singh



HI Rajendra Singh,

Even to create the number of buttons i need to know the amount of data right i.e (number of buttons=total number of data/record per page) if any data is inserted to the table i cannot change the number of buttons and While writing the SQL query we need to use LIMIT and OFFSET here ,I think OFFSET is not Supported by outsystem platform.Can You please suggest me anything regarding this.

Thanks,

Ronan T.


Solution

HI Rohan,

As per my understanding there are only two way to Achieve this functionality.,first is use the outsystem pagination and second is to create your own pagination by writing some logic.

If you don't want to go with oustsystem one.Then you have to write some logic. and yes there will be some limitation to achieve this.

I have achieved the similar functionality in my project. While creating a search page, because of the huge record in the result set pagination was responding too slow.

Don't use the link button use expression with link.

Put maximum number of expression with link, i am sure pagenumber link will between 3 to 10 add two more next and previous, For example if you will click on the next button it should change the value of the expression which will increment by 1. use the site property to hide/show the link according to the page number (Total records/record per page).

In your case you can write a small extension on .net or java with two input parameter pagenumber or offset, select query and one output parameter of list type.

Thanks

Rajendra Singh

Solution

Hi Ronan,

If you implement pagination correctly, you can reuse the same Aggregate (using the Data Refresh tool) as reevaluating it would return different results.

I'm failing to understand what is your requirement and why you cannot use the typical way of solving this problem.

Please check the RichWidgets lesson and exercise to better learn how to implement pagination. Once it is clear how to do it, if it doesn't suit your needs you will be better equipped to explain how your requirements stop you from doing it the easy way.

Raj wrote:

HI Rohan,

As per my understanding there are only two way to Achieve this functionality.,first is use the outsystem pagination and second is to create your own pagination by writing some logic.

If you don't want to go with oustsystem one.Then you have to write some logic. and yes there will be some limitation to achieve this.

I have achieved the similar functionality in my project. While creating a search page, because of the huge record in the result set pagination was responding too slow.

Don't use the link button use expression with link.

Put maximum number of expression with link, i am sure pagenumber link will between 3 to 10 add two more next and previous, For example if you will click on the next button it should change the value of the expression which will increment by 1. use the site property to hide/show the link according to the page number (Total records/record per page).

In your case you can write a small extension on .net or java with two input parameter pagenumber or offset, select query and one output parameter of list type.

Thanks

Rajendra Singh

Hi Rajendra Singh,


what is the next step after writting extension on java, could you please explain


Thanks,

Ronan T


Raj wrote:

HI Rohan,

As per my understanding there are only two way to Achieve this functionality.,first is use the outsystem pagination and second is to create your own pagination by writing some logic.

If you don't want to go with oustsystem one.Then you have to write some logic. and yes there will be some limitation to achieve this.

I have achieved the similar functionality in my project. While creating a search page, because of the huge record in the result set pagination was responding too slow.

Don't use the link button use expression with link.

Put maximum number of expression with link, i am sure pagenumber link will between 3 to 10 add two more next and previous, For example if you will click on the next button it should change the value of the expression which will increment by 1. use the site property to hide/show the link according to the page number (Total records/record per page).

In your case you can write a small extension on .net or java with two input parameter pagenumber or offset, select query and one output parameter of list type.

Thanks

Rajendra Singh

Hi Raj,

I was able to paginate as per your idea but the problem is i need to implement universal search along with this, this pagination will search data only from the fetched record but not the records which are present in databases,can you please suggest me anything regarding this.


Thanks,

Ronan T.