具有UserEvent SuiteScript 2.0,它仅在UI中执行创建支持案例时触发,而不是通过电子邮件提交创建案例时触发。
/**
* Support Case Users Scripts
*
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @ModuleScope SameAccount
*
*/
define(["N/log"], function (log) {
var exports = {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function beforeSubmit(context) {
log.debug('before submitting', 'in');
}
exports.beforeSubmit = beforeSubmit;
return exports;
});
[也尝试过beforeLoad
和afterSubmit
,此外ModuleScope
尝试了Public
。脚本部署已选择所有27个上下文。通过UI在所有情况下都可以查看日志。在同一事件中激发工作流也遇到了麻烦。我有一个可以使用SuiteScript 1正常运行的脚本,因此我可以扩展它,尽管我希望继续在2.0中工作。
通过电子邮件提交支持案例时,脚本部署 Status
需要设置为Released
才能触发脚本。