1

I'm trying to create events from a sheet of a column of dates and a column of data.

I'm getting hung up on this error message:

Cannot find method createAllDayEventSeries(string,string,string). (line 14, file "Code")

My code is attached in the screenshot, and for the most part I followed the Gsuite tutorial online, even though I used allday event code as I do not have times in my sheet.

Any clue as to where I'm going wrong?

screenshot of my code

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • 1
    Welcome. Code should be added as text, not as image. – Rubén Nov 30 '19 at 22:55
  • I'd guess the second parameter is not date and the third is possibly not a recurrence. Try `var Date=new Date(shift[0]);` and see if the error changes. [Reference](https://developers.google.com/apps-script/reference/calendar/calendar#createAllDayEventSeries(String,Date,EventRecurrence)) Welcome to StackOverFlow please take this opportunity to take the [tour] and learn how to [ask], [format code](https://meta.stackexchange.com/questions/22186/how-do-i-format-my-code-blocks) and [mcve]. – Cooper Nov 30 '19 at 22:57

1 Answers1

0

The problem is that the parameters are of the wrong type. According to https://developers.google.com/apps-script/reference/calendar/calendar#createalldayeventseriestitle,-startdate,-recurrence

Parameters

Name        Type                Description
title       String              the title of the events in the series
startDate   Date                the date of the first event in the series (only the day is used; the time is ignored)  
recurrence  EventRecurrence     the recurrence settings of the event series

but you script is passing all the parameters as Strings

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166