사용자 지정 재 할당 항목 페이지를 만들려고합니다. 주요 차이점은 예상 발송 날짜의 데이터입니다. 내가하고 싶은 것은 Item ID와 Location에있는 항목을 기반으로 하위 목록을 채우는 것입니다. 표준 재 할당 항목 작동 방식과 같습니다.Netsuite - 항목 및 위치 검색을 기반으로 하위 목록을 채우는 방법
지금까지 나는 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');
}
}
}
제 질문은 어떻게 항목 재 할당에서와 같은 방식으로 하위 목록을 채우는 것입니까? 감사합니다.
무엇이 당신의 질문입니까? – Sabuncu
ID 및 위치에서 표준 재 할당 항목 페이지와 마찬가지로 하위 목록을 채우려면 어떻게해야합니까? – shutdowndev