Access to First, Previous, Next, Last record on summary tab

For accessing the next and previous records from the summary page view i have been applying the following logic on primary key and its giving me the required result of giving the previous and last records correctly.

a!queryEntity(
entity: cons!TT_TimesheetLog_Cons,
query: a!query(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 1,
sort: a!sortInfo(
field: "id",
ascending: if(ri!fetchingPrevious, false(), true())
)
),
filter: a!queryFilter(
field: "id",
operator: if(ri!fetchingPrevious, "<", ">"),
value: ri!currentPrimaryKey
)
)
).data.id

now the situation is following:

-like the next and previous buttons, I also want the last and first buttons which should take me to the first and last records in the grid, e.g. if i have 100 records the first button should open the first record summary view tab and the last button should open the 100th record. Currently I am not able to do that.

-also if i am on the last record lets say 100 i want the last button to be disabled in that scenario, similarly if i am on first record i want the first button to be disabled.

How can i achieve these two functionalities?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Sadia_Rashid

    Nope. Once you retrieve the data in descending order, then the first record is basically the last record. If you look at the 10th row, there is a condition that if position="LAST" then we're fetching the data in descending order. 

    Also, if it worked, please consider accepting the answer so other people can find the right answer if they are facing the same problem and other contributors do not invest their time in providing solutions. 

Children
No Data