by SBarnes » Wed Mar 16, 2022 1:46 pm
The attached works in a Jiwa Demo database all I did was change your save end to a save start and removed the call to sales order save, which is probably a better way to do it as with what you had the order is being saved twice because save end is called after Jiwa has saved the order and then you are doing it again.
You could also put the code in the sales order line added and sales or changed events so the user sees that is going to back order before they save which might be a bit more user friendly but if you do you will probably need to detach and then reattach the events after the code fires so you don't have the event handler firing the same event on itself.
- Attachments
-
Plugin Test - New Plugin Sales Orders.xml
- (35.88 KiB) Downloaded 342 times
Regards
Stuart Barnes