Really weird error

aleix1979aleix1979 Member Posts: 213
I have the following code:

LocalSSH.RESET;
LocalSSH.SETRANGE("No.",ILE."Document No.");
//temp
IF LocalSSH.FINDSET THEN;
//temp
IF LocalSSH.FINDSET THEN;
//temp

And while doing the first findset I get the following message:
"The Sales Shipment Header already exists"

:shock:
Navision Developer

Comments

  • BeliasBelias Member Posts: 2,998
    i think you're in a newer version of nav, and that this piece of code is only a part of the whole process. in your process you probably do some inserts. These inserts are bulked with the Bulkinserts feature, and are flushed at the first database read (your findset). For testing purposes, change your inserts to "if insert then;" (ONLY FOR TESTING PURPOSES, BE CAREFUL!)
    ...and then run debugger without break on triggers, of course
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • BeliasBelias Member Posts: 2,998
    sorry, you won't catch the error doing IF INSERT...instead do a
    if not insert then error('here there is a duplicated key')
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.