這可以通過給源到您的下拉菜單來完成。源字段接受列表的內部標識。這個內部ID可以是內置的(由netSuite提供)或由用戶創建的自定義列表。例如:我有一個內部id爲'23'的自定義列表,裏面有一些列表項,可以通過下面的語法在下拉菜單中填充這些列表項。
var start = function(request, response) { var form = nlapiCreateForm('Custom Form'); form.addField('custpage_selectfield', 'select', 'select a color', '23');//here 23 is the internal id of my list respnose.writePage(form); }
或者你可以生成你自己的領域的動態使用addSelectOption()函數。
var start = function(request, response) { var form = nlapiCreateForm('Custom Form'); var myselectfield = form.addField('custpage_selectfield', 'select', 'select a color'); myselectfield.addSelectOption('1', 'Red');//Here 1, 2 and 3 are the id's myselectfield.addSelectOption('2', 'Green');//which are returned when the myselectfield.addSelectOption('3', 'Blue');//form is submitted respnose.writePage(form); }
我不能完全理解你想什麼來實現或如何填充您的動態列表,但我想,如果這對你的作品,然後去了。在不相關的說明中,Field Changed事件處理程序具有void返回類型,因此不需要返回true。 – erictgrubaugh