Hey all. I’m struggling to make a script work. Whe...
# suitescript
f
Hey all. I’m struggling to make a script work. When I add a Group Item to an order, I’ve been unsuccessful in retrieving values in the rows that follows. I need to take the amount in the EndGroup row and divide by quantity on the main row for that Group Item. But everything I’ve tried fires before the lines are retrievable. Does anyone know if this can be achieved? Would it work with an asynchronous function or something?
b
what have you tried
f
validateLine fieldChanged with a timeout to try and wait for the lines validateLine
sublistChanged have I thought of, but that would trigger every time something is changed, hence be terrible for performance - so haven’t tried that
b
number 1 rule of entry points is to return early when the conditions of your script arent met
in this case, you dont have a choice on the entrypoints, you only have sublistChanged
f
I know. But sublistChanged has still been less nice to use
b
or maybe saveRecord if you are willing to wait until before you save the record
f
you mean beforeSubmit?
The user wants to see it right away
b
if you wanted something more immediate, then sublistChanged is your only choice