Problem
Properties of the Script
function onEdit(e) {code}, function onEdit1(e1) {code}, function onEdit2(e2) {code}, function onEdit3(e3) {code}, function onEdit4(e4) {code}, function onEdit5(e5) {code}
var range = e.range;
and OnEdit5 has var range = e5.range;
My Understanding
Why I'm asking this
Iterations of this question seem to have been asked before. But people generally give advice on integrating two functions into one big one, rather than preparing someone to integrate 10-20 different OnEdit functions. Nor do they give a clear indication of best coding practices.
I've spent hours reading through this subject and feel that people new to scripts, like me, would greatly benefit from knowing this.
Thank you in advance for any contributions!
onEdit
is triggered automatically on (You guessed it!)editonEdit1
or onEdit2
....code.gs
file or even in a single project, there can only be one function named onEdit
and trigger successfully.onEdit
will trigger in each project asynchronously. But there are limits to number of projects that can be created and other quotas will apply.sorting
various values inside the script is better than repeatedly calling .sort
on the multiple ranges multiple times. The lesser the interaction between sheets and scripts, the better. A highly optimized script will only require two calls to spreadsheet: one to get the data and the other to set the data.(However, if you only need one sort
without the need to get/set data, then calling .sort
is usually faster than get
and set
)