我想编辑一条记录,然后点击“保存”,并使用新值更新字段“custitem_con”并保存记录。
/**
*@NApiVersion 2.0
*@NScriptType ClientScript
*/
define(['N/currentRecord'],
function(currentRecord) {
function saveRecord (){
var objRecord = currentRecord.get();
var con = 'Success!...but record is not saved :(';
objRecord.setValue({
fieldId: 'custitem_con',
value: con,
});
}
return {
saveRecord: saveRecord
};});
然而,当字段custitem_con获取值时,记录不会保存,而是保持编辑模式。如何保存记录?
答案 0 :(得分:2)
为了允许提交记录,您需要addlist (a:as) (b:bs) = if a <= b then a : addlist as (b:bs) else b : addlist (a:as) bs
addlist [] bs = bs
addlist as [] = as
函数return true
,因此:
saveRecord()