Has anyone run into this and reached out/received ...
# suitescript
n
Has anyone run into this and reached out/received a response from Netsuite?: • I have a UE script on Invoices that gets the linecount • It then loops through the lines totaling the quantity of each line • Then sets a field on the header • Found a DEFECT where when you do a Mass Update, it runs your UE but if you have a linecount the value returned is 0 instead of the actual linecount value (my case would be 17) ---------------------------------------------------------------------------------- • Edit/Save Invoice : linecount (17) Header Field (3.5) • Mass Update: linecount (0) Header Field (0)
b
a
are your mass updates changing the quantities/lines? because you can just turn it off in the mass update context to avoid things getting set to 0. similarly you can have it do nothing in the event that linecount = 0 since invoices have to have lines i think?
if you're wanting to update the lines/quantities with the mass update and WANT it recalculate them... that's not going to happen. you might be able to update them via CSV? test it first though.
r
Is it not possible do a search on that specific invoice in after submit, and get the qty sum through search itself instead of iterating through the lines and then apply to header field?
a
... yeah that'd probably work you could also potentially write the formula for that search into the value for the field itself and uncheck store value, but that usually isn't helpful since you can't really do anything with it
n
I fixed by only setting my values if a line count is greater than 0 in y UE. I just didn’t realize mass update will return 0 for linecount in suitescript even if there are invoice lines
b
inline edits dont have lines
n
Is mass update considered inline edit?
b
n
@Anthony OConnor @raghav the code was never a problem and was working fine. I just noticed that when we did a mass update, my code read the lincount as 0 instead of 17 like it does when working in the UI.
r
Got that, I was just giving a different approach to handle the scenario.