Renumbering Sales Lines.

Q1970Q1970 Member Posts: 34
Hi,

I have this customer who regularly gets in conflict with the AutoSplitKey function on his Sales Orders, since he needs to be able to insert a lot of lines between the ones that are already there. I'm thinking about writing a little function which will:

1. Copy all the lines on the sales order in question to a temporary table.
2. Delete the original sales lines.
3. Run through the lines in the temporary table and put them back in the sales line table, ordered in a nice 10000 > 20000 > 30000 fashion, thereby enabling my customer to insert lines again.

I am aware that I will have to take care of the "Attached to line no." field, but I would like to know if there are other factors that I need to take into consideration before I do this.

Anyone?

/Q

Comments

  • SavatageSavatage Member Posts: 7,142
    edited 2008-02-25
    What's the confict? You should be able to insert 9999 lines?

    Each line no starts 10000 then 20000, etc
  • kinekine Member Posts: 12,562
    You need to think about assigned charges, reservations.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Q1970Q1970 Member Posts: 34
    Savatage wrote:
    What's the confict? You should be able to insert 9999 lines?

    Each line no starts 10000 then 20000, etc

    The confict is, that the Autosplitkey-function "halves" the difference between the two line numbers. When I insert a line between 10000 and 20000, the

    If I need to insert a number of text lines between line no. 10000 and 20000 (and assuming that i start with the first text line) then I'm limited to 14 or 15 lines before Autosplitkey function hits the final sequence 19990, 19995, 19997, 19998, 19999 and then runs out of numbers.
  • Q1970Q1970 Member Posts: 34
    kine wrote:
    You need to think about assigned charges, reservations.

    I will think about that as well. Thanks! :)
  • vanrofivanrofi Member Posts: 272
    You could change the + 10000 to +100000 per Line (in code of course)

    This way you have more lines possible between 2 existing Lines.
  • jreynoldsjreynolds Member Posts: 175
    kine wrote:
    You need to think about assigned charges, reservations.
    Also if you have posted shipments that haven't been invoiced then the sales shipment lines have a reference to the order line no. that is used when posting the invoice.
  • SavatageSavatage Member Posts: 7,142
    i'm curiuos about all the insertion.
    is it more items - is it just text for desription, comments , etc

    perhaps if we knew the need for all the insertion a better solution might be possible :-k
  • Q1970Q1970 Member Posts: 34
    Savatage wrote:
    i'm curiuos about all the insertion.
    is it more items - is it just text for desription, comments , etc

    perhaps if we knew the need for all the insertion a better solution might be possible :-k

    O.K. I'll give it a go. :)

    It's not just text. Most of the lines that he adds on the fly, are resource lines. But also text lines and an occasional G/L line.

    His sales orders have a number of "Header lines", describing different parts of that order (e.g.: Roof, Walls, Foundation). As work progresses, he adds lines - mainly of the resource variety but also quite a bit of text, describing the tasks performed - beneath the relevant "Header line". And sometimes, on larger projects, he hits the limit due to the Autosplitkey function running out of free numbers.

    That is pretty much it. I hope it makes a bit of sense. :)

    /Q

    I hope this explains it :)
Sign In or Register to comment.