netsuite - 通过子列表创建自定义记录时发送电子邮件
问题描述
我的销售订单表单上有一个子列表,允许用户直接从销售订单添加自定义记录。
我想做的是在创建该自定义记录时发送一封电子邮件,但在通过子列表创建记录时它不起作用 - 仅在从自定义记录表单创建时。
通过子列表创建记录时是否可以发送电子邮件?
解决方案
从子列表创建的事件不会被 UserEvent 捕获。您可以创建一个 ClientScript,捕获事件 sublistChanged(context),然后调用一个套件从后端发送电子邮件。
define(['N/runtime', 'N/url', 'N/https'],
function(runtime, url, https){
function sublistChanged(context) {
try {
console.log('Debug: ', '* * * S t a r t * * *');
var suiteUrl = url.resolveScript({
scriptId: 'customscript_xxxxx_xxxxxxx',
deploymentId: 'customdeploy_xxxxx_xxxxxxx',
returnExternalUrl: false,
params: {
custparam_custid : intCustId,
custparam_authorid: userObjId
}
});
var response = https.get({
url: suiteUrl
});
}catch (error) {
console.log('error: ', error);
}
}
return {
sublistChanged: sublistChanged
}
});
推荐阅读
- servicestack-autoquery - 合成字段上的 ServiceStack AutoQuery 崩溃
- dbus - 网络管理器 Dbus 代码“aa{ss}”的含义
- sql - 如何从 SQL 中的 XML 变量中删除包含多个属性的节点
- python - Pytest 忽略 Fixture 中的警告
- cuda - OpenACC 和统一内存
- android - Fragment View.OnClickListener 无法识别点击
- android - 如何在 recyclerview 中加载更多视频,如图像?
- python - 计算、比较和聚合 pandas 数据框
- automata - “如何制作 {w ∈ {a,b}∗ | 2na(w) = 3nb(w)} 的图灵机。我的问题是如何应用条件”
- r - 如何使用 dplyr 以长格式按组创建计数