How do i insert sales line new value?

yukonyukon Member Posts: 361
Hi Expert,

I want to insert sales line between two sales line. Pls look image. I want to insert more line between exist sales line. That Line no is auto generate.

Line No. Item
10000 1000
20000 1001

When user press button. I want to get...

Line No. Item
10000 1000
12500 1250 // New Line -> System Auto Insert (Item is user selected item)
15000 1002 // New Line -> System Auto Insert (Line No. system gen:)
20000 1001


Please help to me
Best Regards,
Make Simple & Easy

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi Yukon,

    The line number is assigned when the record is inserted. Why have you put the line number on the form as this is an internal field?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • Ian_Piddington10199Ian_Piddington10199 Member Posts: 167
    Hi Yukon

    As Dave says the Line No is assigned when the record is entered.

    as you are entering a line between lineno 10000 and line no 15000 it should get lineno 12500 when you fill in another piece of data so that NAV knows its a new record. Each time you insert a new line between 2 exisiting lines the ne line will get teh number half way between the exisiting ones, assuming there are any.

    But from your original note
    When user press button. I want to get...

    Line No. Item
    10000 1000
    12500 1250 // New Line -> System Auto Insert (Item is user selected item)
    15000 1002 // New Line -> System Auto Insert (Line No. system gen:)
    20000 1001
    are you wanting to know how to get these 2 lines to automatically be entered in the correct place based on some sort of setup somewhere? If thats the case take a look at how the Explode BOM function on Sales lines works as it does this.

    Ian
    Regards

    Ian
  • garakgarak Member Posts: 3,263
    as Dave and Ian said. The "Line No." will be "created" when the insert command is fired.
    The system generated automaticly a new No. The reason herefore is, that the field "Line no." is the last part of the primary key and it is an integer field.
    With the property "Autosplit" Key on your subform, the system generates the number self (for example 15000 if you are between the lines 10000 and 20000).
    So you doesn't need to display the "Line No." in your Subform.

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.