Netsuite记录加载



我可以加载带有硬编码ID的记录,但我不确定如何在用户事件脚本的"提交后创建"方法中动态获取此ID。此代码位于用于创建UserEventType的if块中。是否有一些变量可用于newrecord的id?

谢谢

var Bill = record.load({
type: record.Type.VENDOR_BILL, 
id: 13295,
isDynamic: true
});

在创建时,记录id直到提交后阶段才可用。在那里你可以从新的记录中获得

function afterSubmit(context){
const newRec = context.newRecord;
const billRec = record.load(
type:newRec.type,
id:newRec.id,
isDynamic:true
});
...

以防万一它能帮助其他人。我能够获得内部id并加载这样的记录:

var recordId = scriptContext.newRecord.id;

log.audit({ title: 'NEW', details: recordId });
// get bill to index
var Bill = record.load({
type: record.Type.VENDOR_BILL, 
id: recordId,
isDynamic: true
});

最新更新