onScheduledEvent not registered error

Hi,

We are developing a marketplace app, in that app, we are using the scheduled event for our use case. The app works fine locally when we deploy the app as a custom app to Freshdesk, the app throws the below error,

    { status: 400, message: 'The app has not registered an onScheduledEvent' }

Even though we have registered the onScheduledEvent the custom app is throwing the above error.

The registered event in the serverless app,

const handler = require("./lib/handler")

exports = {
	events: [{ event: "onScheduledEvent", callback: "onScheduledEventHandler" }],

	onScheduledEventHandler: function (payload) {
		handler.scheduleHandler(payload)
	}
}

Please help us resolve the issue.

Thanks,
Arshath

2 Likes

@Saif @Raviraj @velmurugan

Could you guys help me in this regard? One of our apps are on hold for deployment at marketplace because of this issue.

1 Like

@arshath.h
could you send the whole app code?

1 Like

@velmurugan

I have sent the file in DM.

Thanks,
Arshath

2 Likes

Hi @velmurugan,

Have you had a chance to look at this issue? Please let me know if you need my assistance.

Thanks,
Arshath

1 Like

Hey @arshath.h

just a clarification, does the error occur during installation or while scheduling a task?

1 Like

@velmurugan

On Scheduling a Task.

1 Like

Hi Arshath,
Can you please check the payload which you are passing in the scheduler event (createScheduler function)?
and please ensure it follows the standard as per the docs Scheduled Events

I am assuming the time which you are passing is not in the correct format :slight_smile:

3 Likes

Hi @Santhosh,

The payloads are passed to schedule event by following the standards as per the docs.

If the payload to the scheduled event is not in a correct format, it should not work in local environment right ?

Thanks,
Arshath

1 Like

Hi @arshath.h,

Can you please try publish a new custom app and check if everything looks good?

Thanks,
Aravind.

4 Likes

Hi @Aravind_Dasarathy,

Thanks for taking your time to look into this.

I am getting the same error.

1 Like

Hey Arshath,
I found an issue in your code, you are using platform version as 2.1 which is not supported in freshdesk
Please refer this doc for more reference

Kindly let me know if you are having other questions on this…

Thanks
Santhosh B

@arshath.h

Please see this this reply helps you debug for the problem,

1 Like

@Saif @Santhosh

Thanks for your help. It works now.