i dont know how to even ask this.. but I have a cu...
# suitescript
k
i dont know how to even ask this.. but I have a custom 2.0 suitelet that is displaying 4 different sublists on tabs, with form buttons to execute actions via a 2.0 clientscript. What i am having issues is trying to get the linecount of the sublist without loading the record from the clientscript. I am able to do so if using v 1.0 client Api references but not with 2.0 API . Can anyone explain how i am doing something stupid ,without seeing all the code mess I have, to help steer me in the right direction ? Since i am new to the whole suitescripting thing I am embarrassed by the code i am producing... i am willing to share the code if need be.. a little more context.. var lineCount = r.getLineCount({sublistId:'custpage_my_bnwt'}); returns an error in the console " bootstrap.js:184 Uncaught TypeError: r.getLineCount is not a function "
b
more code needed, but the error is pretty clear
whatever r is dooesnt have a getLineCount function
👍 1
k
yea.. should be record.. but i am missing something .. i am not a confident scripter.. just thrown into this.. nlapiGetLineItemCount(type) Record.getLineCount(options) N/record Module was hoping it was just a 1<->1 replacement .. but not so much..
b
nlapiGetLineItemCount is not equivalent to the N/record module in a client context
k
thanks.. I figured as such..
b
suitescript 2.0 makes a distinction between the current record in client script, which is the N/currentRecord Module
and basically every other record, which is N/record
they do behave very similarly, getLineCount should function the same in both
which means that the guess is that you arent working with either a record or a currentRecord
you would actually need to share your code
k
i am embarrassed to do so. but sure.. will clean up and pull some repetitive functions..
Untitled.txt
snippet2.txt
the first is the Suitelet.. the second is the client script.. Sorry I have to handle a family issue.. any input would be greatly appreciated..
basically getting line counts of the selected checkbox items..
b
error is correct as far as i can tell
N/currentRecord Module Members lists the methods available for N/currentRecord
k
oh great thanks.. I will need to find another way to get my line counts.👍
b
its more that you arent using the modules correctly
both of the record related apis have ways of loading a record object
you skipped that part
k
yea thanks i will need to do a lot more reading.. I appreciate your help though