Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

My function includes adding a menu and toast to the document. I have verified that the trigger (onOpen) is set as well. It only works when a user goes into Tools, Script Manager, Run. We have too many users with too many backgrounds to expect then to know how to do this. Why isn't it working? (Using Chrome)

function onOpen()
{
  var menus = [{name: "Advance in Workflow", functionName:"sendEmail"}];

     SpreadsheetApp.getActiveSpreadsheet().addMenu("Auto Advance FG Workflow", menus);

  //sheet.toast(Notify/Remind users);
   sheet.toast("While you are here we kindly ask that you do not add, modify or remove     any columns.","Welcome - " + username,8);
 }

Thanks,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

I was having the same issue.

I realized, sometimes Google create some kind of cache of the scripts (I'm used to have a "test" script and I usually alter it's content, and, sometimes, the script runs as if I didn't).

So, what I did that solved the onOpen() not working was changing the function name and ading a trigger manually.

Go to "Resources -> Current script's triggers…"

Go to "Resources -> Current script's triggers…"

Choose the function to run on open

Choose the function to run on open

It worked like a charm here!

Updated Location Information: from tool bar or from menu bar

Then

trigger select


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...