Insert records on Sales Lines

I have 2 diferente users on the same time, inserting records in sales line, on the same Sales Order.

Each user does not see the lines that other user is inserting.

How can I control the sales order lines insert?

At this moment, Iget a error message when one of user insert a line record:

" The Sales Line already exist

Identification fields and values

Document Type = ‘Order’

Docuent No = ‘123’

Line No. = 3500"


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.

Is that possible?


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).


I have already disabled MultipleNewLines property in Form, but the problema maintain.

What can I do ?


That was worth a try.

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.

I think the best way to solve this issue is create diferente lines on each form.

Each user insert lines on your one form.

How and where can I force lines No. to be B00001, B00002,… one one of the forms, and on the order for to be IN00001, IN00002,…?


You can’t! Line no. is an integer field.

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.”.