为什么当我使用初始化触发器函数时,我总是找不到脚本函数:发送发票如果新
Why do I keep getting Script function not found: sendInvoiceIfNew when I use the initializeTrigger function?
function initializeTrigger(){
// run this only once to create a trigger if necessary
var sheet = SpreadsheetApp.getActiveSpreadsheet();
ScriptApp.newTrigger('sendInvoiceIfNew')
.forSpreadsheet(sheet)
.onChange()
.create();
}
function sendInvoiceIfNew(e){
Logger.log(e.changeType);
if(e.changeType=='INSERT_ROW'){
sendEmails();
Browser.msgBox('New row(s) added');
}
}
有人可以帮我解决这个问题吗?sendEmail功能工作正常,但失败电子邮件摘要显示"找不到脚本功能:sendInvoiceIfNew"。提前谢谢。
尝试使用工作表 ID 或工作表 URL 创建电子表格对象。
var sheet = SpreadsheetApp.openById("sheetId_goes_here");
或
var sheet = SpreadsheetApp.openByUrl('sheet_url_goes_here');
相关文章:
- 在wordpress中找不到jQuery函数
- 在页面中找不到元素的正确位置.函数未考虑填充
- JavaScript函数在Safari中有效,但在Firefox中找不到
- 为什么当我使用初始化触发器函数时,我总是找不到脚本函数:发送发票如果新
- 找不到柴函数
- 找不到 jquery 输入自动完成函数
- 谷歌应用程序脚本-正在尝试使用getUrl.TypeError:在对象工作表中找不到函数getUrl
- 继续得到一个错误,即某个东西不是函数,但找不到原因
- Javascript 引用错误 - 在对象内找不到函数
- 谷歌脚本在对象中找不到函数LastIndexOf
- 找不到Google Apps脚本库嵌套函数
- 函数找不到变量
- jQuery函数找不到容器 - 可能是克隆错误
- $(document).ready() 中的函数找不到 DOM 的主体元素
- Ajax函数找不到正确的数据
- ReactJS映射函数找不到未定义的属性
- jQuery's getScript函数找不到我的.js.Rails中的动词模板
- jQuery的点击函数找不到选择器
- Angular 2-从JS文件(chart.JS)调用函数-找不到函数
- JS构造函数找不到全局变量