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.