I have worked in windows forms app C#, uwp apps. As far those are concerned, the debugging is quite easy, I put a breakpoint where I need to pause execution to see the current values of the variables where I put breakpoint, I check the values by either mouseover or using autos. But I am new to Sheets app script, and tried to find how to debug. but could not get. Here is by onEdit event function.
function onEdit(e) {
var range = e.range;
// range.setNote('Last modified: ' + new Date());
// range.setBackground("green");
Logger.log("hello this is onEdit");
if(range.getNumRows() === 1 && range.getNumColumns() === 1 )
{
if (range.getValue = "Done")
{
range.setValue("Weekly");
}
}
}
I put this function inside code.gs under files section. It works well. But If I put a breakpoint, and edit anywhere in the sheets, the breakpoint is not called. If I click the 'Debug'(Debug the selected function) menu, the debugging works. but the parameter e is not defined, since the OnEdit function is not called from sheets by cell edit.
I am clueless how to debug the onEdit function, by editing a cell ?