I would like to perform a specific task based on time so i choosed scheduled events for my work around.i created a schedule in my server.js by SMI function. This SMI is invoked from my app.js.
my ‘onScheduledEventHandler’ is not executed on scheduled time .it’s executed only on local simulation i can get data while simulation
I registered a scheduled event and SMI functions in my manifest.json
Could you share the script you’re using to generate the “schedule_at” time?
This time should be in ISO string format which will be in the UTC timezone always.
In your mention, the time (2023-05-22T11:57:00.000Z) means 5.27 PM in your local time if you’re in India. Please check the log at the time to see if it has been triggered.
You can use the following script to generate a time that’s 6 minutes more than your current time in ISO string format.
You are correct now i’m able to run my ‘onScheduledEvent’ . i have one more doubt shall we update our one time schedule because i have a use case to run this schedule at every week and i know about the recurring schedule we cannot have multiple recurring schedule in our app right so i’m using one time schedule in our app . if i update one time schedule i’m getting an error
@Kithiyon Yes, it’s possible to update a schedule.
If a scheduled event has already been executed, it won’t exist anymore and cannot be updated. You can create a new schedule with the same name after executing the previous one. Only before execution the one-time schedules can be updated.
If there’s a recurring event, the event will still be registered after one execution since the subsequent execution will run next. So, the recurring schedule can be updated anytime until it’s deleted.