我正在尝试提交记录后更新一个字段,但是该字段没有更新。我知道脚本正在触发,因为调试显示了oldweight值。您能否在AfterSubmit用户事件中更新字段。
// 2.0 - Fluent
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(["N/record"], function (r) {
function onAfterSubmit(context) {
var oldweight = context.newRecord.getValue({ fieldId: 'custbody93' });
log.debug({
title: 'Old Weight',
details: oldweight
});
if (oldweight) {
var fixWeight = context.newRecord;
context.newRecord.setValue('custbody103', 'oldweight');
};
}
return {
afterSubmit: onAfterSubmit
};
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句