So
I'm getting this error
Oops You do not have permission to call query (line 7)
When I try to query a ScriptDB database in an onEdit() function within Google Spreadsheet Apps script. Below is the code I use to get the repeatable error:
function onEdit(){
//tell me event has happened
Browser.msgBox("onEdit() Fired")
//get ScriptDB reference
var db = ScriptDb.getMyDb();
//perform any query
var results = db.query({})
}
Replace onEdit() with notonEdit() and it works as expected when triggered manually.
function notonEdit(){
//tell me event has happened
Browser.msgBox("notonEdit() Fired")
//get ScriptDB reference
var db = ScriptDb.getMyDb();
//perform any query
var results = db.query({})
}
Is there some sort of permission I am not correctly setting or are ScriptDB queries not allowed to function in event functions by design? Is anybody else seeing this problem?
Tom