This topic has been discussed many times, unfortunately I have found in the forum posts no one that fits my current problem. To the point: A customer of us has a special field, which is calculated for each line ,among other things, based on the weight of the sales document. In each line it has the same value. If lines are now deleted, the weight inevitably changes, so the value of the special field must be recalculated. To do this, I call a codeunit in the OnAfterGetRecord trigger of the Subform 46, which in turn calls a code unit for the price calculation, in which, among other things, the value of this particular field is calculated. Unfortunately, MODIFYs are also executed on the sales line in these codeunits. If I now delete several sales lines at once, the well-known and popular error appears: "Another user has ...".
Mind you, this only happens if I mark several lines and delete them in one step. If I delete them successively with F4, it works.
In my distress I l have a COMMIT accommodated behind the Codeunit, which calls the Codeunit for the price calculation, (I hate this), without success.
The basic problem will be that I'm in the subform, and start a call that modifies the underlying records. The price calculation can also be called out of the form having the form 46 as a subform, then the problem does not appear. Is there a workaround for this? I've already considered something like closing the Form and then reopening it, but I do not know how. Does anyone have an idea?
With best regards