Home > Software design >  Unexpected error while getting the method or property create on object ScriptApp.CalendarTriggerBuil
Unexpected error while getting the method or property create on object ScriptApp.CalendarTriggerBuil

Time:05-13

I have code that has always worked but today it is giving me an error. I'm not sure if this is a bug or something else.

function myFunction() {
  ScriptApp.newTrigger("calendarUpdatedEvent")
        .forUserCalendar(Session.getEffectiveUser().getEmail())
        .onEventUpdated()
        .create();
}

function calendarUpdatedEvent(e)
{
  Logger.log(JSON.stringify(e));
}

Exception: Unexpected error while getting the method or property create on object ScriptApp.CalendarTriggerBuilder.

enter image description here

CodePudding user response:

Apparently, this is a bug according to this bug report: https://issuetracker.google.com/issues/232107679.

Check there for details.

CodePudding user response:

As a workaround, you can create the trigger with the "Add Trigger" button from the Triggers List View instead of programmatically, it seems to work

  • Related