如何使用请求getparameter获取Suitelet中子列表的数据? [英] How to get data of sublist in suitelet using request getparameter?
本文介绍了如何使用请求getparameter获取Suitelet中子列表的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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{
}
在if部分中创建表单,但在else部分中如何获取request.getParameter中子列表的数据.
form is being created in if part but how to get data of sublist in request.getParameter, in else part.
推荐答案
您可以执行request.getLineItemCount('custpage_orditemslist')
和request.getLineItemValue('custpage_orditemslist','custpage_selectitem',x)
.
这篇关于如何使用请求getparameter获取Suitelet中子列表的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文