New to custom apps : how to create events to raise onScheduledEvent

Hello,
I am currently working on a custom app in Freshservice and I need some assistance. Specifically,
I am trying to raise onScheduledEvent.

I’ve got these errors in the browser, nothing in the “fdk run” log

Can you help me or tell if there is more informations about it somewhere.

Thank you

Have a nice day
Geoffroy
manifest.json:
{
“platform-version”: “2.3”,
“product”: {
“freshservice”: {
“location”: {
“full_page_app”: {
“url”: “template.html”,
“icon”: “icon.svg”
}
},
“events”: {
“onScheduledEvent”: {
“handler”: “onScheduledEventHandler”
}
}
}
},
“engines”: {
“node”: “18.12.1”,
“fdk”: “9.2.0”
}
}

app.js:

function clickButton(){
let currentTime = new Date();
currentTime.setMinutes(currentTime.getMinutes() + 5);
client.request
.invoke(‘createSchedule’,{scheduleName:‘GeoffroyEvent’,scheduleAt: currentTime.toISOString()})
.then(function onSuccessSMI(data) {
console.info(server method invoked ${data});
})
}

server.js:
exports = {
onScheduledEventHandler: function (args) {
console.log("onScheduledEvent: " + JSON.stringify(args));
},
createSchedule: function (data) {
console.log(data);
$schedule
.create(data)
.then(
function operationPerformed(data) {
console.log("Schedule created successfully: ", data);
renderData(null);
},
function operationErr(err) {
console.error("Schedule creation failed: ", err);
renderData({
message: "Schedule creation failed: " + JSON.stringify(err),
});
}
);
}
};

Found my issue, I was missing the “functions” sections in the manifest.json :
{
“platform-version”: “2.3”,
“product”: {
“freshservice”: {
“location”: {
“full_page_app”: {
“url”: “template.html”,
“icon”: “icon.svg”
}
},
“events”: {
“onScheduledEvent”: {
“handler”: “onScheduledEventHandler”
}
},
“functions”: {
** “createSchedule”: {**
** “timeout”: 5**
** }**
}
}
},
“engines”: {
“node”: “18.12.1”,
“fdk”: “9.2.0”
}
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.