调用方法guestsCanModify()时发生错误

问题描述 投票:1回答:1

我在脚本中有以下代码:

var createdEvent = CalendarApp.getCalendarById(calendarId).createEvent(title, startTime, endTime, options);

createdEvent.guestsCanModify(true);

当我调用“ guestsCanModify()”方法时,出现以下错误:

Cannot find method guestsCanModify(boolean)

我为脚本启用了以下作用域:

"oauthScopes": ["https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
"https://www.google.com/calendar/feeds",
"https://www.googleapis.com/auth/spreadsheets.currentonly",
"https://www.googleapis.com/auth/spreadsheets"]

我使用这种方法不正确吗? The documentation对我来说似乎很模糊。

google-apps-script
1个回答
1
投票

我使用了错误的方法。正确的方法是“ setGuestsCanModify()”。

Documentation here...

© www.soinside.com 2019 - 2024. All rights reserved.