Has newRecord.getLineCount(sublistId) always retur...
# suitescript
w
Has newRecord.getLineCount(sublistId) always returned 0 in beforeLoad in view-mode for all sublists? I can't remember I ever stumbled upon this. Feel like I should be able to read the contents of the list if I need to.
I could load the record to get the sublists, but that adds some exec time
n
I don't think so. I just tested it and it worked fine for me on a purchase order
w
Thanks for testing. And this was in VIEW?
n
Yes sir
w
confusednick
n
w
I'm running this on a custom record
and in edit mode
n
well that's just maddening..
I wonder if the sublists aren't stored with the record? kind of like how non-stored fields won't return a value with rec.getValue()? Im guessing
w
It's very quick to load the record in beforeLoad in this case so it doesn't matter much. But very unexpected.
c
@Watz Are those all child record sublists?
w
Yup
all the "recmach" at least.
c
Which appeared to be the ones that showed values on edit but not view, correct?
w
Yes
c
My guess is that since the parent-child relationship is determined by a field on the child record, there's some fakery going on in terms of how and when Netsuite constructs the "machine" for that sublist, and that they don't make it for View mode.
👀 1