Without testing it even further, then I would expect that disabling the MultipleNewLines property on the subform could do it. But that is changing how to insert empty lines etc.
When that is said then this request is rather special. Why would anyone have two different users enter lines to the same sales order?
I have 2 different users inserting lines in the same sales order, because each one works on a distintct department. One insert pordut line with PostingGroup = X, the other insert produt lines with PostingGroup = Y.
This procedure lasts more than one day, and they insert lines on different times, so i wil have all lines mixed.
I created 2 different forms for each user.
Each one only sees his lines.
A good solution wil be: Create a special No. lines for each user.
Not a bad idea using special line numbers for each user. That could work, if you use a line no. filter and maybe say numbers below 100,000,000 are the first “filter” and those above, the other. You just have to code some checks to see that it will start/end correctly. With some work it could do it.
But did you try disabling the MultipleNewLines first? If that could do the job, then it would be a lot less programming (because the above changes with line no. are not going to beautiful).
Then you either need to change the code or the way they work with it today, so that the issue doesn’t become a problem.
If the suggested solution using hardcoded line number filters doesn’t work, then alternatively you could let them create orders separate orders, and then upon release of the order merge them into the primary order? But that’s a lot more work/code than the “filter” solution.
But you can try it with the hardcoded filters as I suggested above. Then it will work almost the same, but where B: Line No. 0…99999999 and IN: Line No. 1000000000…999999999999 (or something similar).
A little hardcore:
In Form-trigger OnInsertRecord the record has been assigned a “Line No.”.
But the record has still not been inserted.
Now you can check if this “Line No.” does exist allready - before the INSERT is performed; and you can find and assign a new and available “Line No.”.
I am not sure this solution will work every time. But in theory, it should.
Remember: write an “EXIT(TRUE)” at the end of the trigger!
I would rather go for this solution:
Create a new form and use that to create a new record.
Have user to fiil in insert (at least) mandatory fields.
Then you make the INSERT; and now you can assign an available “Line No.”.