`sublistChanged` might be what you want in this ca...
# suitescript
e
sublistChanged
might be what you want in this case
w
@erictgrubaugh is there a way to have a sublist update from a
record.load()
? My script runs on the
validateLine
and loads the Item record and updates the Base price but the discount lines don't change. My Item record is loaded in Dynamic mode.
e
In
beforeLoad
you can only change fields that are not stored, unless you are creating a new record
From Help's
beforeLoad
page:
Copy code
Notes:

beforeLoad user events cannot be triggered when you load/access an online form.

Data cannot be manipulated for records that are loaded in beforeLoad scripts. If you attempt to update a record loaded in beforeLoad, the logic is ignored.

Data can be manipulated for records created in beforeLoad user events.

Attaching a child custom record to its parent or detaching a child custom record from its parent triggers an edit event.
w
Actually I'm running a ClientScript that loads the Item record so I can make changes to it.
e
Copy code
var rec = record.load();
rec.selectLine(...);
rec.setCurrentSublistValue(...);
rec.commitLine(...);
rec.save(...);
That's how you work with a sublist in dynamic mode
w
Yeah.. that's what I have. But the rest of the price list don't recalculate.
I update my Base Price. My 2 discount lines don't automatically adjust like they do if I change the Base Price from the UI.