I'm developing an add on for Google Sheets. While doing so I encountered following exception
Exception: The add-on attempted an action that is not permitted in Test as add-on mode. To use this action, you must deploy the add-on.
Here is the gist of code for which I'm getting an exception
function initiateCall()
{
try
{
var sp = SpreadsheetApp.getActiveSpreadsheet();
var sheet_obj = sp.getSheetByName(SHEET_NAME);
var last_row = sheet_obj.getLastRow();
var result = "failure";
if(last_row >= 2)
{
Logger.log("Creating");
var trigger_id = ScriptApp.newTrigger('triggerToInitiateCall').timeBased().after(100).create();
Logger.log("Created");
setProperty("trigger_id", trigger_id.getUniqueId());
result = "success";
}//if
else
result = "validation_failure";
return result;
}//try
catch(e)
{
Logger.log("Exception=> "+e+" At Line Number "+e.lineNumber)
}//catch
}//initiateCall
Note: - Script is running in AuthMode.NONE mode - Script is standalone script.
The reason behind using triggers is to make asynchornous UrlFetch.
So I have two questions to ask
- Is it possible to make Asynchronous UrlFetch from Google App Script?
- If not how to create time driven triggers in Google Sheet Add On (alternate way to make kind of an async UrlFecth)?
Please help. Any help is appreciated.