When creating a button for the UI, how do I get th...
# suitescript
s
When creating a button for the UI, how do I get the current record? I'm doing currentRecord.get(), but it is still returning -1 for sublist item count
b
more context needed
user events and client scripts can be used in too many ways
n
You will need client script. Call the client script function from the button.
d
I'm going to guess you are in View mode not Edit mode & that is why you are getting
-1
instead of what you are expecting in my experience this is just a limitation of using currentRecord like that - must be in Edit mode instead
s
correct. I ended up having to do a record.load since currentRecord.get() wasn't working