custom events from timer deploy not working

the custom events and timer are not working after being deployed.
working in debug but on deployment.

Hi Evangelos,

could you please provide us more info? It’s hard to guess what happened without additional information.

Regards,
Stanislav

Hello Stanislav,

I have used your documentation to setup up a javascript custom event & timer and they work in debug using code runner. but when I deploy they don’t do anything.

Can you please provide me with an example of a simple async custom event that gets and saves data async and returns a value to async custom event?

Have you seen this documentation?

https://backendless.com/documentation/business-logic/js/bl_custom_events.htm
If you scroll down you can find a simple example of an async event.

Method signature:

Backendless.Events.dispatch( eventName, eventArgs, Async );

Example:

var eventArg = {weather:"sunny"}; 
var successHandler = function( response ) {};
var errorHandler = function( response ) {}; 
Backendless.Events.dispatch( "foo", eventArgs, new Backendless.Async( successHandler, errorHandler ) );

Regards,
Stanislav

Hello Stanislav,

this doesn’t work! it doesn’t return anything, nor if you give it a task like saving data it will not complete it, because it doesn’t call the event. at least not from the code runner .

This doesn’t call the custom event from a timer!

-Evangelos

Hi Evangelos

Take a look at this example showing how to perform some async operations in custom event handler and return the response

If you need an example of calling custom event handler from a timer take a look at this example

Hello Vitaly,

will this work after i deploy? how do i debug after i have deployed?

my current instance works perfectly fine in debug using code runner but have deploying it doesn’t

-Evangelos

You can use Logging API of Backendless SDK in addition to console.log messages to log some debug information at various steps of your server code and check that logs later

More Information can be found here :
Logging Configuration and Viewing
Using Logging in Business Logic (server code)
Example of Logging API call from Timer

With the latest changes all the messages printed using ‘console.log’ method calls are now automatically being redirected to the Backendless.Logging Service

Please read more here