Hello,
I tried to look for some answers on the forum but could not find a clear explanation.
I have a custom app with schedules that works fine locally. Then I packaged it and uploaded it on the instance as a custom app. Unfortunately, whenever a user tries to create a schedule (e.g., 2021-11-28T21:28:00.000Z) from the front-end (clicking a button triggers $schedule.create()), it fails with a vague error message:
{ status: 400, message: 'Schedule event could not be created' }
@Santhosh
We don’t get anything more than this message in the logs and the payload (not the real one for privacy) looks good:
{ scheduleName: 'faf3-d716-4554-47c4', scheduleData: { subject: 'blahblah' schedule_utc: '2021-11-28T21:28:00.000Z' }, iparams: { __meta: { secure: [Array] }, domain: 'blahblah.freshdesk.com', api_key: 'blahblah' }, '$domain': 'blahblah.freshdesk.com', isInstall: false, account_id: 000, region: 'US' }
With the event:
createSchedule: function(args) {
$schedule.create({
name: args.scheduleName,
data: args.scheduleData,
schedule_at: args.scheduleData.schedule_utc
}).then(function(data) {
renderData(null, data);
}, function(err) {
console.log(args)
console.log(err)
renderData(err);
});
}
For version 2.2:
"functions": {
"fetchSchedule": {
"timeout": 10
},
"createSchedule": {
"timeout": 10
},
"updateSchedule": {
"timeout": 10
},
"deleteSchedule": {
"timeout": 10
}
}
Doe we need to setup anything for the scheduler to work? We haven’t setup any onAppInstall() since none was required during our testing locally.
Thanks!