NextControl creates new line

MagnoMagno Member Posts: 168
Hey,

i have a list form, but only 2 fields are editable in it.
So i set the nextcontrol of those 2 to each other.
so on the last field, it jumps to the next record. So far, so good.

But when it is on the last record. and on the last field, it creates a new line. but i only want them to create a new line when they explicitly say it. not when they press enter on the last field of the last record.

Anybody some ideas?
There are no bugs, only random undocumented features...
---
My Blog: http://NAV-Magno.be

Comments

  • ArhontisArhontis Member Posts: 667
    A bit tricky...

    :-k :idea:

    Maybe you could delete the NextControl property and on the OnAfterInput trigger of the second control you could check if the next line is empty and then go to the first line.

    Maybe something like:
      TempRec.COPY(Rec);
      TempRec.GET(....);//get the current rec...
      IF NOT TempRec.NEXT THEN
         IF Rec.FIND('-') THEN ;
    

    I haven't tried it but it may help you...
  • MagnoMagno Member Posts: 168
    Doesn't look bad on the first look, but always asks if i want to rename the record.
    There are no bugs, only random undocumented features...
    ---
    My Blog: http://NAV-Magno.be
  • ArhontisArhontis Member Posts: 667
    Yep, you are right.
    #-o #-o :(
    I tried a few expirements of my own but I couldn't find a solution.

    I don't think I can come up with anything else...

    Sorry Freightliner...
  • jmjm Member Posts: 156
    Hi,

    i did no test, but may be this helps:
    TempRec.COPY(Rec); 
    TempRec.GET(....);//get the current rec... 
    IF NOT TempRec.NEXT THEN 
      IF Rec.FIND('-') THEN 
        xRec.Copy(Rec);
    
    br
    Josef Metz
    br
    Josef Metz
  • ngebhardngebhard Member Posts: 127
    When there are only two fields editable and users are allowed to insert a new line, the key fields of the table are filled by filters or something like that, right? At least you know where to get the entry of the other fields (especially the key fields)? Then maybe this could work (didn't try it yet):

    set the "InsertAllowed"-property to no. Then no new line will be inserted. Make a function with the shortcut F3, where you insert a new line. After inserting make a GET to the new record to be in the right line.

    Actually this could work?!

    Greetz
    Nicole
    ProTAKT Projekte & Business Software AG
    Microsoft Dynamics NAV Partner
    Bad Nauheim, Germany
    http://www.protakt.de
    http://twitter.com/protakt
Sign In or Register to comment.