Hi All!
I've developed a CodeUnit that imports about 10000 Sales Lines in 6 different sales order. The customers wants it this way, so I can't do anything about it. So the code loop does something like:
Read All lines into ExcelBuffer
Create Header 1
Create Sales Line 1
Create Sales Line 2
Create Sales Line 3
...
Create Sales Line 2000
Create Header 2
... etc.
Anyway, while importing the lines, which takes about 1 hour, the other users can't create new Sales Order. We get an error when trying to get a new Sales No. for the order. It says that the serial lines table is blocked.
Is there any workaround, so I can make sales orders while importing? I was reading about COMMIT, but not sure if this will help in my situation.
Thanks.
0
Comments
Yes, COMMIT will be part of your solution. You need to design a process to break this into smaller recoverable steps. Using COMMIT to end each step and commit the changes to the database. You must structure the process so it can recover from a failure without failing or creating duplicate orders or order lines. The smaller the steps, the shorter the locking events will be.
You might also need to some performance tuning.