Is there something specific I need to do to get th...
# suitescript
t
Is there something specific I need to do to get the amount (id:usertotal) to update on a vendor bill after setting items on the item sublist? It for some reason isn't updating. I'm doing this from a client script in pageInit, setCurrentSublistValue with forceSyncSourcing:true on every single value. Doing it from the UI has the amount automatically update. I'm not sure why it isn't updating when doing it from code
a
I'm assuming you are committing the lines you add. not sure what the issue could been, seems like it should update, if it isn't that field is writable, so you can just set it yourself... it will get overwritten again if items/pricing are changed in the UI
t
I am committing yes, and not using ignoreRecalc either. I'm a little concerned to update it myself because of taxes, but that really does seem like the only solution for now.
a
i think even if you set it wrong, and no changes are made, it will get overwritten to be correct in a beforeSubmit / saveRecord type context
t
I'll have to try it, I still find this incredibly odd. I don't really know enough here but my impression was dynamic mode could be the exact same as doing it through the UI
a
right, it should be, this is weird, i agree
you're not crazy 😄
t
I was hoping there was some small mistake I was making. My first attempt I was doing a user event script which wouldn't even source the item sublist values like amount (rate * quantity). Seems this one is just different
Ah unfortunately it says to adjust the items or press recalc if it doesn't match. Well I guess this is still a problem
a
the lines that are added are added correctly? with a qty, rate and amount which is qty*rate?
t
Yea all I do is set: item and rate. One item has a quantity (others are discounts). With the client script now at least amount populates properly
For now I just loop over every line, add up the amount and set that manually. It lets me save the record directly at least, and you were right that it updates to include taxes. If I dont put the amount in, it doesnt let me save
a
I'm literally reading suiteAnswers where it says to just use a client script to select and commit a line, to force recalc.... so this should work
t
😔 I couldn't find much online which makes me believe it should work too. Maybe I'll try on a different account.. I really have no clue here.
a
on your commitLine you've not set
ignoreRecalc: true
right?
sorry, had to ask
t
Yea just commitLine({ sublistId: 'item'});
a
weird, let me know if you ever get a definitive answer