How to Set List Navigation Start Index Dynamically

How to Set List Navigation Start Index Dynamically

  

Hi,

I have a table with from and to dates,

I am using list navigation and display one record per page.

I have three records in my table

FromTo
01/06/201730/06/2017
01/07/2017
31/07/2017
01/08/2017
31/08/2017


When i load the screen, i want to display the second record.

My use case is like i want to display the record based on current date. 

I assume we need to set List_Navigation_GetStartIndex dynamically

Could anyone help me how to do that in list navigation?



Solution

Hi Sekar,

The List_Navigation_GetStartIndex function accepts a 3rd parameter (which is optional) where you can set the start index.

Thus, if you use it like this:

List_Navigation_GetStartIndex(Table.Id, True, 1)

it will start on the second record (the first record has index 0).

Cheers,

José

Solution

José Costa wrote:

Hi Sekar,

The List_Navigation_GetStartIndex function accepts a 3rd parameter (which is optional) where you can set the start index.

Thus, if you use it like this:

List_Navigation_GetStartIndex(Table.Id, True, 1)

it will start on the second record (the first record has index 0).

Cheers,

José

That solution isn't Dynamic, you will always show the second record. Next month you will have a new Date and 4 records. If you don´t delete the first record, the output will be wrong. 

Sekar if you will add more dates, change the index for the row number where month = current month

Hi João,

The solution José presented is the way to do what Sekar needs (the thing he didn't know about).
Now he just needs to add logic to determine what is the start index he wants to pass in the 3rd parameter.

Cheers,
Eduardo

Hi João,

As Jauch said, you can just use a variable in the 3rd parameter of the List_Navigation_GetStartIndex instead of a hardcoded value.

It depends on your needs.

Cheers,

José

Sorry my bad, i thought he needed the logic because when you put mouse over the function it shows all the 3 inputs.

Hi Joao,

Sorry I didn't see the third parameter, Thanks guys for your help.


Sekar you are right. In the studio (10.0.611.0) when with the mouse over in right proprieties bar it appears one hint with only two parameters. But in editor it appears the 3 parameters

Hi,

How can i set start index dynamically on press of buttons in the list_navigation,

Example :if i click 2 in list_navigation the startindex should be 11 and on click of 4 the start index should be 31 

can I achieve this because  i need to limit the records.

Thanks,

Ronan T

Ronan T wrote:

Hi,

How can i set start index dynamically on press of buttons in the list_navigation,

Example :if i click 2 in list_navigation the startindex should be 11 and on click of 4 the start index should be 31 

can I achieve this because  i need to limit the records.

Thanks,

Ronan T

This is in build feature of List_Navigation. Sounds you have 10 items in a page right? Then LineCount is 10 (Usually coming from "MyTableTR.LineCount")

TotalRowCount is what you get from aggregate "GetAllEntities.Count", which is total number of entities in table. (If you use other source, you need to solve total count otherways.)