0
作成したフォームサブリストにデータを追加しようとすると、何かが見当たりません。 サブリストには、データの最初の行が入力されますが、それ以外は入力されません。
私はUIのリストオブジェクトを使用しようとしましたが、フォームとは別のようです。ここでの目標は、そのレコードに関連するいくつかのサブリスト(保存された検索に基づいて)を含むレコードを表示することです。Suiteletサブリスト(serverWidget.createform.addSublist)にデータ行を追加するには
助けがあれば助かります。
が
var mySearch = search1.load({
id: 'customsearch511'
});
var resultSet = mySearch.run();
var list = form.addSublist({
id: 'custpage_sublist',
type : serverWidget.SublistType.LIST,
label: 'Lines'
});
resultSet.columns.forEach(function(col){// This adds columns to the sublist based on the search results
list.addField({
id: col.name,
label: col.label,
type: serverWidget.FieldType.TEXT
});
});
for(var i in results){
var result = results[i];
for(var k in result.columns){
var test = result.columns[k];
if(result.getText(result.columns[k])){ //This is to get the values of any select field in the search
var fieldValue = result.getText(result.columns[k]
)}
else{
var fieldValue = result.getValue(result.columns[k]
)};
list.setSublistValue({
id: result.columns[k].name,
value: fieldValue,
line: i
});
//Error out after the first row is entered. When this loops back to the second line of the search results.
}
context.response.writePage(form);