如何使用request getparameter获取suitelet中的子列表数据?

时间:2016-11-11 06:13:05

标签: netsuite

    var form = nlapiCreateForm("Process Order Items");  
    var locField = form.addField('custpage_locationlist', 'select', 'Location', 'location').setMandatory(true);
    if(locationId != '')
    locField.setDefaultValue(locationId);

    var vendorField = form.addField('custpage_vendorlist', 'select', 'Vendor', 'vendor').setMandatory(true);
    if(vendorId != '')
    vendorField.setDefaultValue(vendorId);

    form.addField('custpage_incitemnoprefvendor', 'checkbox', 'Include Items With No Preferred Vendor');
    form.addField('custpage_incitemvendornopref', 'checkbox', 'Include Items Where Vendor is Not Preferred').setDisplayType('disabled');
    var parentField = form.addField('custpage_parentitems', 'select', 'Parent Item', 'inventoryitem');
    if(parentId != '')
    parentField.setDefaultValue(parentId);

    form.addField('custpage_minimunqty', 'integer', 'Minimum Quantity');
    form.addField('custpage_tobeprinted', 'checkbox', 'To Be Printed');
    form.addField('custpage_tobemailed', 'checkbox', 'To Be Mailed');
    form.addField('custpage_tobefaxed', 'checkbox', 'To Be Faxed');
    form.addField('custpage_total', 'float', 'Total').setDisplayType('inline');

    var sublist = form.addSubList("custpage_orditemslist", 'list', 'Order Items'); //staticlist
    sublist.addField('custpage_selectitem','checkbox', 'Select');
    sublist.addField('custpage_location','select','Location','location');//.setDisplayType('inline');
    sublist.addField('custpage_department','select','Department','department').setDisplayType('inline')
    sublist.addField('custpage_class','select', 'Class','classification').setDisplayType('inline');
    sublist.addField('custpage_itemid','select','Item','inventoryitem').setDisplayType('inline');

我可以像这样获取位置和供应商的数据

request.getParameter('custpage_locationlist')
request.getParameter('custpage_vendorlist')

但我的问题是,如何在子集的其他部分获取子列表的数据

if (request.getMethod() == 'GET' )
       {

}
else{

}

表单是在if部分创建的,但如何在request.getParameter中获取子列表的数据,在else部分。

2 个答案:

答案 0 :(得分:7)

您可以request.getLineItemCount('custpage_orditemslist')request.getLineItemValue('custpage_orditemslist','custpage_selectitem',x)

答案 1 :(得分:0)

试试这个

request.getParameter('custpage_orditemslistdata');