首页 > 解决方案 > Outlook 添加(日历事件):重复始终为空

问题描述

我有一个用于日历事件的 Outlook 插件,带有一个任务窗格。从窗格中,我得到事件数据:

   date start: item.start.getAsync()
   date end: item.end.getAsync()
   recurrence: item.recurrence.getAsync()

日期还可以,但重复始终为空(状态 = '成功'),尽管我在事件中更改了重复...

可能是什么问题?

我正在使用开发 Outlook 365 Web

谢谢,

迭戈

编辑: 我在重复发生更改时收到事件:

Office.context.mailbox.item.addHandlerAsync(Office.EventType.RecurrenceChanged, handleRecurrenceChanged);

但是在 handleRecurrenceChanged() 中,重复总是为空... *

标签: eventsnullcalendaroutlook-web-addinsrecurrence

解决方案


使用您在评论中给我的代码,我会在它更改时得到重复:

  Office.context.mailbox.item.addHandlerAsync(Office.EventType.RecurrenceChanged, handler, callback);

但只有“处理程序”函数被调用,其中重复有效:console.log(JSON.stringify(eventarg.recurrence));

  • 为什么不调用回调函数?
  • 为什么我的函数无法重现:

Office.context.mailbox.item.addHandlerAsync(Office.EventType.RecurrenceChanged, handleRecurrenceChange);

在这种情况下,handleRecurrenceChange 被调用但是当我调用 item.recurrence.getAsync() 我得到 result.value = null

如果我在需要重复时调用 item.recurrence.getAsync() 也是一样的(我得到空值)

我想在需要时获得重复(我可以正确获取所有其他事件值),如果可能的话,在更改时不保存它......

问候,

迭戈


推荐阅读