Discussions
Best practice with user event / scheduled scripts
I'm working on a script with the following logic:
1) after saving an item receipt
2) find pending sales orders with unfulfilled items matching the receipt's item list
3) for each identified sales order, update a body field with the total value of committed (but unfulfilled) items
Having the total value of the committed items on each order allows us to select partial orders over a certain value for processing.
This script could affect a large number of sales orders depending on the contents of the receipt, so (as I understand it) in order to allow the user to continue on while the script executes, the best way to accomplish this is to have a user event that launches a scheduled script.