It's very likely that you are running the onformsubmit
function from the script editor which don't send and event object (e
).
In order to run onEdit from the Google Apps Editor for debbuging purposes, you have to create a an auxiliary function to create the event object and assign the required properties. For a broader explanation see the answer from Mogsdad to How can I test a trigger function in GAS?
Related