SAP Knowledge Base Article - Public

3617263 - SAC: Calendar notification emails not received when using SAC Script: createCompositeTask and Date.now()

Symptom

User is using the script like CalendarIntegration and createCompositeTask to create calendar task. 
But the assigned users is not receiving the notification emails on the defined time. 

If user creates the calendar task manually in calendar page in SAC, the assigned users are getting notification emails. 

Environment

SAP Analytic Cloud

Reproducing the Issue

  1. Edit the button script like CalendarIntegration_1.createCompositeTask API  to add your email
  2. go to view mode
  3. click button 

Cause

Script Design of Date.now()

Resolution

  1. Script using var start = new Date(Date.now()) 
  2. Date.Now() is used to get the current date. When the call from this script reaches SAC calendar' API to create the calendar item, this timestamp is already in the past
  3.  
    Solution: adding a few seconds on to the startDate object

See Also

The createCompositeTask API will be deprecated in the future with composite tasks. We recommend using the createProcess API to create a calendar process with similar properties.
See more in SAC help: Use a Calendar Integration Technical Object and Related APIs

Keywords

SAC: Calendar notification emails not received when using SAC Script: createCompositeTask and Date.now() createProcess API createCompositeTask API composite task assigned users are getting notification emails , KBA , LOD-ANA-PL-PRO , Planning Process, Input Task, Calendar Task , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem

Product

SAP Analytics Cloud 1.0