javascript - Set line items in custom sublist -
a lot of tutorials or reference on how deal netsuite sublist none of them fits needed.
i need update/add custom sublist created in suitelet through client script. suitelet code
//this custom sublist var sublist = form.addsublist('targetlist', 'list', null, 'target_list'); sublist.addfield('industry', 'text', 'industry'); sublist.addfield('inp_name', 'text', 'name'); and in client script want add line items when field change like
function targetlistclient(type, name, linenum) { if(name == 'industry') { nlapiselectnewlineitem('targetlist'); nlapisetcurrentlineitemvalue('targetlist', 'industry', 'test'); nlapisetcurrentlineitemvalue('targetlist', 'inp_name', 'test again'); nlapisetcurrentlineitemvalue('targetlist', 'jobtitle', 'another test'); nlapicommitlineitem('targetlist'); } } i think should work got error. uncaught typeerror: cannot read property 'checkvalid' of undefined
i try set line item nlapisetlineitemvalue('industry', 1, 'again') instead of selecting current line item not working.
am implementing sublist concept incorrect? can guide me on this. thanks.
in function targetlistclient, give value field jobtitle, sublist creation code has fields industry , inp_name.
Comments
Post a Comment