I want to move a row from one spreadsheet (JobRequest) to another (Accepted) spreadsheet by clicking the checkbox automatically (no yes/no button) (located in col G). There are 7 columns of data to be moved. I want a dialog to popup at the time the box is checked too, to confirm that they have read that dialog box and accepted.
Ideally, I can log this and if they exit out of the dialog box the box unchecks, but I haven't gotten that far yet, so that's for another post.
For now, can you help be figure out where I went wrong for this checkbox to move to another sheet?
I keep getting the error
Error
TypeError: Cannot read property 'source' of undefined
I thought I already had it defined.
function onEdit(e){
const src = e.source.getActiveSpreadsheet();
const r = e.range;
if(src.getName()!= 'JobRequests' || r.columnStart !=7 || r.rowStart == 1) return;
const dest = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Accepted');
src.getRange(r.rowStart,1,1,7).moveTo(dest.getRange(dest.getLastRow()+1,1,1,7));
src.deleteRow(r.rowStart);
}
function showFeedbackDialog() {
var widget = HtmlService.createHtmlOutputFromFile("AcceptanceForm.html");
widget.setWidth(400);
widget.setHeight(500);
SpreadsheetApp.getUi().showModalDialog(widget, "Send feedback");
}