简体   繁体   中英

How Do I Get My Installable Trigger to Run Once and Not Twice?

I have a simple onEdit script that can run longer than 30 seconds, depending on what I am doing on my spreadsheet and in some cases, I need this to happen.

I understand, if I do not use an installable trigger in this case, that the simple onedit script will time out. So I now have a simple onEdit trigger and installable onEdit trigger that can run at the same time.

But here is my problem. I mentioned that I need my script to run longer than 30 seconds sometimes. But if I use an installable trigger, in conjunction with the simple trigger, the onEdit function will begin to cause the changes that do not require 30 seconds of run time to fire twice and I don't want this to happen.

Incidentally, if I do not use an installable trigger and only use the simple trigger, the changes that do not require 30 seconds of run time fire once and do as I need. But then the changes that require 30 seconds of run time times out, incompleting the tasks that I need done.

So how do I get the installable trigger to run the changes needed under 30 seconds once, while still giving me the ability to run changes longer than 30 seconds when needed?

You are right about that the simple triggers cannot run for longer than 30 seconds, while the installable ones do.

So, why do you not user ONLY the installable trigger without the simple one. You can bind it to any desired function, it doesn't need to be called onEdit() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM