所以我正在尝试创建一个自定义的Reallocate Items页面,主要区别在于预期发货日期中的数据 . 我想要做的是,根据项目ID和位置中的内容填充子列表 . 就像标准重新分配项目的工作方式一样 .
到目前为止,我已经创建了一个ff js作为一个西装让页面 .
var form = nlapiCreateForm('Reallocate Items');
nlapiLogExecution('DEBUG', 'DEBUG', form);
form.setScript('customscriptcust_reallocate_field_change');
var item = form.addField('item','select', 'Item','item');
var location = form.addField('location','select', 'Location','location');
var qtyonhand = form.addField('qtyonhand','float', 'Quantity On Hand');
qtyonhand.setDisplayType('disabled');
var qtycommitted = form.addField('qtycommitted','text', 'Quantity Committed');
qtycommitted.setDisplayType('disabled');
var qtyrequired = form.addField('qtyrequired','text', 'Quantity Required');
qtyrequired.setDisplayType('disabled');
var qtypicked = form.addField('qtypicked','currency', 'Quantity Picked');
qtypicked.setDisplayType('disabled');
var units = form.addField('unitofmeasure','select', 'Units','unitstype');
units.setDisplayType('disabled');
var sublist = form.addSubList('sublist','list', '')
var checkbox = sublist.addField('checkbox', 'checkbox', 'Allocate');
var orddate = sublist.addField('orderdate', 'date', 'Order Date');
orddate.setDisplayType('disabled');
var expshipdate = sublist.addField('cust_tl_expectedshipdate', 'date', 'Custom Expected Ship Date');
expshipdate.setDisplayType('disabled');
var custreqdate = sublist.addField('custreqdate', 'date', 'Customer Request Date');
custreqdate.setDisplayType('disabled');
var ordernumber = sublist.addField('ordernumber', 'text', 'Order No.');
ordernumber.setDisplayType('disabled');
var specialorder = sublist.addField('specialorder', 'text', 'Special Order');
specialorder.setDisplayType('disabled');
var customer = sublist.addField('customer', 'select', 'Customer','customer');
customer.setDisplayType('disabled');
var qtyord = sublist.addField('qtyord', 'float', 'Quantity Ordered');
qtyord.setDisplayType('disabled');
var qtyremaining = sublist.addField('qtyremaining', 'float', 'Quantity Remaining');
qtyremaining.setDisplayType('disabled');
var commit = sublist.addField('commit', 'text', 'Commit');
commit.setDisplayType('disabled');
var qrtcommitted = sublist.addField('qtycommitted', 'float', 'Quantity Committed');
form.addSubmitButton('Submit');
form.addResetButton('Reset');
response.writePage( form );
这是我的客户端脚本 .
if ((name === 'item' || name === 'location') && !isEmpty(nlapiGetFieldValue("item")) && !isEmpty(nlapiGetFieldValue("location"))){
var item = nlapiGetFieldValue('item');
var unitstype = nlapiLookupField('item',item,'unitstype');
nlapiSetFieldValue('unitofmeasure',unitstype);
var location = nlapiGetFieldValue('location');
var filters = new Array();
filters[0] = new nlobjSearchFilter( 'inventorylocation', null, 'anyof', location );
filters[1] = new nlobjSearchFilter('internalid', null, 'anyof', item);
var columns = new Array();
columns[0] = new nlobjSearchColumn('locationquantitycommitted');
columns[1] = new nlobjSearchColumn('locationquantityonhand');
var search = nlapiSearchRecord( 'item', null, filters, columns );
if (search){
var searchrow = search[0];
var quantitycommitted = searchrow.getValue( 'locationquantitycommitted' );
var quantityonhand = searchrow.getValue( 'locationquantityonhand' );
//var quantitypicked = searchrow.getValue( 'quantitypicked' );
nlapiSetFieldValue('qtycommitted',quantitycommitted);
nlapiSetFieldValue('qtyonhand',quantityonhand);
nlapiSetFieldValue('qtypicked', '100');
}
}
}
我的问题是如何填充子列表就像它在Reallocate项目中的工作方式一样?谢谢!