Justin TriadTechx
Justin TriadTechx

Reputation: 43

TypeError: Cannot find function createAllDayEvent in object Calendar

This is a snippet of my code below. I have not modified it in several months and it has been working without a hitch until all of a sudden today I am getting a "TypeError: Cannot find function createAllDayEvent in object Calendar." when I try to submit my Google Form.

Anybody able to point me to what might be the cause? Is it a Google Update or is their something I need to update because Google changed something? Thanks

//Get the calendar
  try{
    var cal = CalendarApp.getCalendarById('davie.k12.nc.us_d2mv2eb8aspuant1vb5j6r3sis@group.calendar.google.com');//Change the calendar id, this one is shared with you and is a test agenda where we can write ANYTHING ;-)
    if(cal){
      //Create the events
      Logger.log(eventDate);
      var newID = cal.createAllDayEvent(eventCalSubject, eventDate, {description:eventCalDetails}).getId();
    }

Upvotes: 1

Views: 515

Answers (1)

Clark Lind
Clark Lind

Reputation: 46

My scripts broke in the last 24 hours also. I submitted an issue: https://issuetracker.google.com/67890149

The reference example produces the same error:

// Creates an all-day event for the Woodstock festival (August 15th to 17th) and logs the ID.
var event = CalendarApp.getDefaultCalendar().createAllDayEvent('Woodstock Festival',
    new Date('August 15, 1969'),
    new Date('August 18, 1969'),
    {location: 'Bethel, White Lake, New York, U.S.', sendInvites: true});
Logger.log('Event ID: ' + event.getId());

Upvotes: 3

Related Questions