Strange problem Autosplitkey

ChristelChristel Member Posts: 28
Hello,

I've got the weirdest problem at a customer. Working with Nav 5.0 SP1 update 2 (without maintenance so I can't upgrade to a higher version)

When entering sales lines 9 out of 10 times everything works fine, but sometimes it go's like this:

Entering the first line, no problem
Entering the second line, when leaving the line it jumps to the fist line Line no becomes 5000 instead of 20000
Entering the third line, same as second line no becomes 2500

Compiled the database, backed it up and restored it problem stays on the order that went wrong.

](*,) ](*,) ](*,) ](*,)
I'm out of resources :oops:

Christel.

Comments

  • MBergerMBerger Member Posts: 413
    i think this occurs when you use a different sorting than the primary key in a form with the property autosplitkey enabled, either by design ( dataitemtableview ) or by the user selecting another sorting in the form itself. The fact you are saying that the line moves after inserting only adds to my suspicion. You might want to check that out.
  • ChristelChristel Member Posts: 28
    Thanks for your repley, I tought exactly the same. But noby's touching the sorting nor is their anything changed on the forms.

    I've copied the database on my laptop, with the same client I get the same behavior.

    Backed up the database and restored it with client 5.0 without SP1 and it works. ](*,)
  • ChristelChristel Member Posts: 28
    If I use the 5.0 client on the 5.0 SP1 database it works to :lol:

    Opening the DB with client 5.0 SP1 and it's wrong again :-k

    Downgrading the client's will be the answer :-$
  • kinekine Member Posts: 12,562
    What about different zup if you use different version? Try to delete zup in the not-working environment to be sure that it is not in it...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ChristelChristel Member Posts: 28
    Yep I'm sure it's not the zup. Error happens sometimes on an order when it happens the error stay's with the order. Even if you take a backup and restore it on an other machine error stay's but using the older client helps :-k

    The server were the error happens is brand new but already using 11,4 of the 12 gig,
    maybe to slow for client 5.0SP1 and not for 5.0??
  • awarnawarn Member Posts: 261
    I am getting the same issue in Nav 6, some forms seem to do autosplit key in the wrong direction, like I am inserting above the record instead of below.

    No wacky keys or anything, did you ever find a solution to your issue?
  • ben5000ben5000 Member Posts: 110
    edited 2012-06-11
    I'm facing the same problem.
    When I try to insert a new line on a document form (with AutoSplitKey and DelayedInsert set to TRUE) I've 2 different behaviors:
    If I input the line manually --> The 2nd record is correctly inserted with a Line No. of 20000
    If I use the lookup to select an Item. No. --> The 2nd line gets a Line No. of 5000 the form is re-sorted.

    Here is the code used in the OnLookUp of the "Item No." field:
    Item No. - OnLookup()
    PurchLine.SETRANGE("Document Type", PurchLine."Document Type"::Order);
    PurchLine.SETRANGE("Document No.", "Purchase Order No.");
    PurchLine.SETRANGE(Type, PurchLine.Type::Item);
    ItemLookupForm.SETTABLEVIEW(PurchLine);
    ItemLookupForm.LOOKUPMODE(TRUE);
    IF ItemLookupForm.RUNMODAL IN [ACTION::OK,ACTION::LookupOK] THEN BEGIN
      ItemLookupForm.GETRECORD(PurchLine);
      VALIDATE("Item No.",PurchLine."No.");
    END;
    

    I've checked the filters and everything is default (sorting on primary key in ascending order)
  • gerrykistlergerrykistler Member Posts: 149
    What code is in the OnValidate of the "Item No." field in the table?
    Gerry Kistler
    KCP Consultores
  • ben5000ben5000 Member Posts: 110
    What code is in the OnValidate of the "Item No." field in the table?
    Item No. - OnValidate()
    ...Some code...
    [b]xRec := Rec;[/b]
    ...Some code...
    

    ](*,)

    Thanks for your help :)
  • gerrykistlergerrykistler Member Posts: 149
    Well I don’t know what ..some code.. does, but the problem maybe the xRec := Rec which is causing havoc with the autosplit key.
    Gerry Kistler
    KCP Consultores
  • ben5000ben5000 Member Posts: 110
    Yes this is the piece of code which provoque this error. :)

    Thanks :)
  • ben5000ben5000 Member Posts: 110
    Yes this is the piece of code which provoques this error. :)

    Thanks :)
Sign In or Register to comment.