SuiteScript 2.0 手动添加项目到通信选项卡

SuiteScript 2.0 manually add items to communications tab

我需要手动将电子邮件行项目添加到交易的通信选项卡,但我似乎找不到任何相关文档。我将非常感谢有关这方面的任何指导。

在此先感谢您的帮助。

messages 子列表不可编辑或动态,因此您不能直接向其中添加项目。相反,您可以通过 N/email.send() API 发送电子邮件并在选项中将相关交易作为相关记录提供。

看起来像:

email.send({
    author: "123",
    recipients: ["test@test.com", "another-test@test.com"],
    subject: "This is an email",
    body: "Probably the best email ever",
    relatedRecords: {
        transactionId: recordId // <-- relevant transaction ID here
    }
});