Form - OnNextRecord

tompynation
tompynation Member Posts: 398
Hi,
when i write following line inside the OnNextRecord trigger of the form, then going to the next record does not work anymore:

gv_WijzAantalKGBool := FALSE;

When i comment this line in the OnNextRecord trigger, it still not working

But when i delete the line, then it works back to normal?

Is this normal?

That gv_WijzAantalKGBool is just a global variable

Answers

  • tompynation
    tompynation Member Posts: 398
    this happens in every form...

    Also in the Demo NAV database.

    When you just write // in the OnNextRecord going to the next record stops working.

    Is this a bug? I have NAV 5.0 SP1 on a windows vista
  • tompynation
    tompynation Member Posts: 398
    i had to exit the step count myself
  • kaelaa
    kaelaa Member Posts: 28
    Hey Tompy,

    OnNextRecord Trigger determines how the system steps through the records in the table. If you write code in that record, Navision assumes that you want the change the way the systme steps through the records. So if you don't write code in the trigger to step between the record, you won't be able to step through your records anymore.
    If you want only to evaluate a boolean variable after each record, put it in the OnAftergetCurrRecord.

    Hope it helps...
  • David_Singleton
    David_Singleton Member Posts: 5,479
    Hi,
    when i write following line inside the OnNextRecord trigger of the form, then going to the next record does not work anymore:

    gv_WijzAantalKGBool := FALSE;

    When i comment this line in the OnNextRecord trigger, it still not working

    But when i delete the line, then it works back to normal?

    Is this normal?

    That gv_WijzAantalKGBool is just a global variable

    I think this was the fist bug I ever reported in Navision Financials.

    The reply from PC&C was that its doing exactly what is says in the user manual. The manual says that "any code written in the trigger will replace the default action." and // is defined as code. (It is a reserved word after all).

    So no its not a bug, just a strange quirk.

    BTW if you think about it, it is quite logical, after all how else can the compiler know that you want to replace the default process.
    David Singleton
  • mpudja
    mpudja Member Posts: 32
    if you want to put some code in form OnNextRecord(Steps) try this

    example:

    NEXT(Steps);
    CurrForm."Due Date".EDITABLE(FALSE);
    CurrForm.UPDATE(FALSE);