Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script CalendarApp.getCalendarById返回null_Google Apps Script - Fatal编程技术网

Google apps script CalendarApp.getCalendarById返回null

Google apps script CalendarApp.getCalendarById返回null,google-apps-script,Google Apps Script,我们正在使用Google Apps Premier,我刚刚注意到CalendarApp.getCalendarById()函数的行为发生了变化,但它一定是在上个月左右发生了变化,因为它在圣诞假期前工作 以前使用CalendarApp.getCalendarById()函数的行为(2012年12月及之前)是一种只要日历资源存在就始终返回日历对象的行为。现在,除非用户已订阅日历资源,否则此函数将返回null。在我所做的测试中,只要我订阅了,我就会得到一个日历资源对象,一旦我取消订阅,我就会得到一个空

我们正在使用Google Apps Premier,我刚刚注意到CalendarApp.getCalendarById()函数的行为发生了变化,但它一定是在上个月左右发生了变化,因为它在圣诞假期前工作

以前使用
CalendarApp.getCalendarById(
)函数的行为(2012年12月及之前)是一种只要日历资源存在就始终返回日历对象的行为。现在,除非用户已订阅日历资源,否则此函数将返回null。在我所做的测试中,只要我订阅了,我就会得到一个日历资源对象,一旦我取消订阅,我就会得到一个空对象。我没有使用常规用户日历进行测试,只使用了资源(如文件室)进行了测试

var calendar=CalendarApp.getCalendarById(calendarID)


这很烦人,因为我需要对许多我不想订阅的房间运行脚本。目前预订房间或日历的方法不太可行。

情况一直如此。您必须已订阅,但尚未实现。我向您保证此代码未更改。

请确保您使用calendarID引用的日历未被删除,并且可以从运行脚本的帐户访问该日历。这是经过明确检查的。日历是存在的,公司内的每个人都可以访问。如何在运行时实际订阅ID