Autosplitkey & Sorting challenge

Lieutenant_Bob
Lieutenant_Bob Member Posts: 15
Hi there, wise forum.

I have a challenge. I am using a subform full of lines, all created with the line no. and Autosplitkey = true.

It all works fine and dandy, as long as the lines are sorted by the primary key.

The users has an option to change the sorting order of the lines, and when they do that, and try to insert a new item, I sometimes get the error:

"The Autosplitkey facility cannot find a key between the current and the previous record"

When examining further, it seems that the line above has a higher number than the line below. This seems to be the problem.. :?

My question:

Is there anyway to let the users change the sorting order AND create new lines at the same time?

Bob
Clothes make the man. Naked people have little or no influence on society.

Comments

  • David_Cox
    David_Cox Member Posts: 509
    On Insert you can code the Line No. useing the primary key on a variable finding last and adding 10000 to the line number, thats fine if you only want to add it to the end, if you want to insert the line in order after the selected record then look at the codeunit explode BOM or insert extended text, this will help you, but you will have to code this.
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com