Setting the current index of TableBox during runtime

m.pacanam.pacana Member Posts: 75
Is it possible to setting the current index of a tablebox to a specific record?

Im currently having problems in filtering records in the table box and once the records are already filtered, the index pointer of the table box stays in a blank record before or after the filtered rows, depending on where it is pointed prior the said action. I want to set the index pointer to the first record everytime I filter rows. Is this possible? #-o

Comments

  • kinekine Member Posts: 12,562
    if Rec.FIND('-') then;
      //it is same as
    if FIND('-') then;
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • m.pacanam.pacana Member Posts: 75
    Thanks! It works!

    Another problem: I have created a button for redisplaying all the records. But after i filter records and then press that button, an alert message "<TABLE NAME> cannot be modified in this form" displays and disables the whole tablebox. Do you know how to fix this?

    btw, in the OnPush trigger of the button, I only placed Clear(Rec);


    Thanks \:D/
  • kinekine Member Posts: 12,562
    You need to do CurrForm.Update(False) to cancel "inserting" new record...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • m.pacanam.pacana Member Posts: 75
    Hi kine, Ive already placed that code in the OnPush trigger, but the error still occurs. #-o
  • kinekine Member Posts: 12,562
    But it depend on when you are calling this. You need to find appropriate point... Beginning, end, after something what move the cursor to new line, after applying filters etc... try to move this command somewhere else or insert it everywhere... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.