“Cannot call SpreadsheetApp.getUi() from this context” error while not using getUi() on time-based trigger
问题 I am trying to run a function every night that checks a list of dates and does work if it finds that a date has passed and all the checkboxes on that row are checked. Every day, though, I get an email saying "Cannot call SpreadsheetApp.getUi() from this context. (line 172, file "Code")". The weird thing is that I don't use getUi() anywhere in my CheckHireDates function and the line that it specifies is not even in the function that is supposed to run. Line 172 is in my onEdit function which