Sales Line "Line No." field issue

markbmarkb Member Posts: 6
edited 2008-05-19 in Navision Attain
Within the past week, a strange issue is sporadically occurring.

When entering a new quote/order, the first sales line "Line No." is assigned 10000. (Like it should be)

However, Navision is occasionally assigning lower "Line No." numbers for subsequent line items. For example, the 2nd line item is assigned 5000.
It's acting like your entering a new line between two existing lines and the AutoSplit key is taking over. However, this is happening on the very bottom line.

In some cases, I have created "test" quotes with two line items like this:
Line item # 1: Type = Item, Line No. = 10000
Line item # 2: Type = Resource, Line No. = 20000

And when I converted it to an order, it did this:
Line item # 1: Type = Item, Line No. = 10000
Line item # 2: Type = Resource, Line No. = 5000

Has anybody ever seen this???

Comments

  • kinekine Member Posts: 12,562
    It seems that you are using another key than primary key to sort the lines on the form. Check that...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    check if there are a other key used in form, or if the key is desc. or if there are a filter and you doesn't see all recs in the form. So the autosplit key can't work well.

    regards
    Do you make it right, it works too!
  • markbmarkb Member Posts: 6
    The sales line form is definately being sorted by the primary key:
    Document Type,Document No.,Line No.


    I did noticed that, when changing the TYPE, it will not always change to what I selected, such as Resource. I have to select it twice from the drop-down. Doesn't happen every time but, when it DOES, is when it screws up the numbering. It's almost as if there is a ghost line item with a Line No. of "0" so my new entry gets insert between "0" and "10000", since the new entry's Line No. is "5000".
  • kinekine Member Posts: 12,562
    Than try use debugger to trace what is happening.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • markbmarkb Member Posts: 6
    I have tried using the debugger and noticed that, when you change the TYPE, it triggers the CAL event the moment you click on your new selection. But those times when my new selection DOESN'T take, no events are triggered. It almost feels like there's a hesitation taking place.
    Like, perhaps, a network problem.
    I think I'll start looking into that possibility because, after all, it IS a sporadic issue.
  • apertierraapertierra Member Posts: 61
    markb wrote:
    Within the past week, a strange issue is sporadically occurring.

    When entering a new quote/order, the first sales line "Line No." is assigned 10000. (Like it should be)

    However, Navision is occasionally assigning lower "Line No." numbers for subsequent line items. For example, the 2nd line item is assigned 5000.
    It's acting like your entering a new line between two existing lines and the AutoSplit key is taking over. However, this is happening on the very bottom line.

    In some cases, I have created "test" quotes with two line items like this:
    Line item # 1: Type = Item, Line No. = 10000
    Line item # 2: Type = Resource, Line No. = 20000

    And when I converted it to an order, it did this:
    Line item # 1: Type = Item, Line No. = 10000
    Line item # 2: Type = Resource, Line No. = 5000

    Has anybody ever seen this???

    It's called inserting between lines...
    if you are inserting before of the first line it takes as line no. the middle number between that line (10000) and the previous line, since there is no previous line, that no. is 0.
  • markbmarkb Member Posts: 6
    I understand what it's supposed to do when inserting between or before an existing line. What I'm saying is that it's doing it when I add a new line at the bottom.
  • apertierraapertierra Member Posts: 61
    markb wrote:
    I understand what it's supposed to do when inserting between or before an existing line. What I'm saying is that it's doing it when I add a new line at the bottom.
    Check the custom code that might be triggered during the process... you might find the reason there.
  • kinekine Member Posts: 12,562
    markb wrote:
    I have tried using the debugger and noticed that, when you change the TYPE, it triggers the CAL event the moment you click on your new selection. But those times when my new selection DOESN'T take, no events are triggered. It almost feels like there's a hesitation taking place.
    Like, perhaps, a network problem.
    I think I'll start looking into that possibility because, after all, it IS a sporadic issue.

    Ok, when you are not changing the type, you can check this:

    1) On the form check the OnNewRecord trigger.
    2) In OnInsert on the table, check if the Line No. is already filled in when the trigger is called. Check if there is correct value.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Just go to the Table designer and look at Table 37 filtered by the Order number. Most likely you have an add on or some custom code that is inserting some hidden lines, like Kits or a BOM mod. Maybe is it not correctly handling the transition from item to Resource, because it had already inserted some line which it then tries to delete, and changes sorting or filtering in the mean time.
    David Singleton
  • markbmarkb Member Posts: 6
    Kamil,

    Regarding step 2

    <<2) In OnInsert on the table, check if the Line No. is already filled in when the trigger is called. Check if there is correct value.>>

    I'm not sure how I can make sure that the value is correct.
    How would I know if the line is be inserted at the bottom or between existing records??
  • David_SingletonDavid_Singleton Member Posts: 5,479
    markb wrote:
    Kamil,

    Regarding step 2

    <<2) In OnInsert on the table, check if the Line No. is already filled in when the trigger is called. Check if there is correct value.>>

    I'm not sure how I can make sure that the value is correct.
    How would I know if the line is be inserted at the bottom or between existing records??
    Just go to the Table designer and look at Table 37 filtered by the Order number. Most likely you have an add on or some custom code that is inserting some hidden lines, like Kits or a BOM mod. Maybe is it not correctly handling the transition from item to Resource, because it had already inserted some line which it then tries to delete, and changes sorting or filtering in the mean time.

    ](*,)
    David Singleton
  • kinekine Member Posts: 12,562
    markb wrote:
    Kamil,

    Regarding step 2

    <<2) In OnInsert on the table, check if the Line No. is already filled in when the trigger is called. Check if there is correct value.>>

    I'm not sure how I can make sure that the value is correct.
    How would I know if the line is be inserted at the bottom or between existing records??

    You know as user if you hit the F3 when you are on the last record or not... and you need to look on the record line no. and the next record line no to know which line no you need to be used (you need what you are really doing and compare it with what system creates for you).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,305
    There might be hidden lines, like the ones that you can't see from the form. It LOOKS as though there are none, but there might be hidden lines that cause the keysplitter to put in those funky numbers. Autosplitkey activity will not show up in the debugger.

    Follow David's advice and check the tables from the object designer.
Sign In or Register to comment.