cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid that two or more people alter the same Sales Order same time

Former Member
0 Kudos

I'm looking for a way to avoid that two or more people altering the same Sales Order at the same time.

If someone has entered a Sales Order in the system and something needs to be adjust it can be done by two or more people at the same time. The problem is that when someone is saving these changes, the changes of another person, who is still working on the same order, get lost.

So what we need is an alert that someone is already using this order and that no other person can make any changes at that time. So the order needs to be blocked for altering for any other person at that time.

To avoid this I think you have to do something with the Stored Procedure. Or has someone a more simple and better solution.

I've already put this thread in the Business One forum and someone suggested to put it in the Business One SDK forum, as there isn't a solution in Business One itself.

So if someone can give me a direction for a solution I would be very pleased.

Best regards,

Tim

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member201110
Active Contributor
0 Kudos

Hi Tim,

The only thing that comes close to what you want in standard SBO is Data Ownership. However, this can't stop someone editing a document that is already being edited.

You can't use stored procedures to track which document is open because the SBO_SP_TransactionNotification proc (which is the only one that you are able to customise) is triggered when a document is updated or added (or cancelled or closed) and not when the document is actually being edited in the user-interface.

You could do this by writing an addon that uses the UI API to trap events in the sales order form. In theory, a sales order is being edited if the sales order form is in Update mode (ie in order for the form to be in Update mode, the user must have selected an existing document and changed the value of at least one field). You can trap the event of the user changing a value and then log the user and document in a table. When other users try to edit the same document, you could check the table and then prevent them changing values. When the first user clicks on the update button (or cancels the update or closes the form etc etc) you can remove the lock on the document. However, I have doubts as to how robust it would be. The problem with this kind of locking solution is that you sometimes get 'stranded' locks (eg user was editing a document when their workstation crashed) and the solution can end up being more troublesome than it is worth.

Kind Regards,

Owen