问题
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');
I am able to get the data of location and vendor like this
request.getParameter('custpage_locationlist')
request.getParameter('custpage_vendorlist')
but my question is, how to get the data of sublist in else part of the suitlet
if (request.getMethod() == 'GET' )
{
}
else{
}
form is being created in if part but how to get data of sublist in request.getParameter, in else part.
回答1:
You can do request.getLineItemCount('custpage_orditemslist')
and request.getLineItemValue('custpage_orditemslist','custpage_selectitem',x)
.
回答2:
try this
request.getParameter('custpage_orditemslistdata');
来源:https://stackoverflow.com/questions/40542148/how-to-get-data-of-sublist-in-suitelet-using-request-getparameter