如何在suitescript 2.0中获取新创建的销售订单内部ID?

fka*_*usi 1 netsuite suitescript suitetalk

我正在编写一个套件脚本来将订单详细信息发送到客户的电子邮件地址。

是否可以通过 scriptContext 或类似方法获取销售订单 ID?

我的功能在提交后在销售订单上运行。

function afterSubmit(scriptContext){

     soid = scriptContext.soid; //<--trying to get the sales order id

}
Run Code Online (Sandbox Code Playgroud)

Mik*_*ins 5

在 afterSubmit 中,您可以使用scriptContext.newRecord.id.

请参阅afterSubmit此处的文档:https : //system.netsuite.com/app/help/helpcenter.nl?fid=section_4407992281.html

record.Record对象成员文档在这里:https : //system.netsuite.com/app/help/helpcenter.nl?fid=section_4267255811.html#bridgehead_4273190849