Is there a way to script adding an item (in this c...
# suitescript
p
Is there a way to script adding an item (in this case a markup item) on every invoice and add it to the last line?
m
yes, you just need to write a user event script for that - the script will check if the item already exists and, if not, will add it on either
beforeSubmit
or
afterSubmit
p
thanks!
s
I'd recommend doing this in a background script unless it really must happen in real time at the moment the user saves the invoice.
m
If you use a user event, do this in beforeSubmit, otherwise you are doubling up on database saves