gpt4 book ai didi

javascript - 我们如何在 UserEvent SuiteScript 2.0 中获取记录类型

转载 作者:行者123 更新时间:2023-11-30 11:22:25 24 4
gpt4 key购买 nike

我们如何在 UserEvent SuiteScript 2.0 中获取记录类型?

我想为超过 1 种记录类型(客户付款、贷记凭证、存款、发票)部署我的 SuiteScript

现在在我的 SuiteScript 中,我需要识别记录类型并根据它执行操作。

我的代码:

define(['N/record', 'N/https'],
function(record,https)
{
function afterSubmit(context)
{
var myUrl = 'My url here';

var rType = context.newRecord.Type;
log.debug({title: 'rType1 ', details: rType });
//This returns nothing

rType = record.Type;
log.debug({title: 'rType2 ', details: rType });
//This gives all the available record types in Netsuite

var JsonPayload = 'need to know whether its an invoice or a payment here';
log.debug({title: 'payload ', details: JsonPayload });

var response = https.post({ url: myUrl, body: JsonPayload});
log.debug({title: 'response ', details: response });
}
}
return {
afterSubmit: afterSubmit
};

});

最佳答案

应该是 ctx.newRecord.type。 javascript 区分大小写。

关于javascript - 我们如何在 UserEvent SuiteScript 2.0 中获取记录类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49305871/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com