Hello,
I have uploaded an event handler, to implement the beforeCreate method.
it was uploaded successfully, but I think it is not called.
i am throwing an exception in the case where my check returned false, and I don’t want the insertion to happen,
yet the insertion still happens.
I assumed that I can prevent the insertion this way. is this correct?
also, can I modify the values of the inserted data?
Does CodeRunner sit and wait for requests? Or the following output shows up right away and CodeRunner quits?
[INFO] If you connected to coderunner for debug - please stop debugging
[INFO] CodeRunner will shutdown now
[INFO] Debugging Utility disconnected successfully
[INFO] Thank you for using Backendless
Now I ran CodeRunner.bat without debug. It waits for events but doesn’t print any of the System.out.println (Which was printed when I used Rest api before).
Yes it is in the debug section (see attached print screen)
and I am creating my object through my android app code. the row is created, but the event handler is not called.
I know it because it is not printing the System.out.println, nor doing an insert i am doing there for testing:
Map testMap = new HashMap();
testMap.put(“testColumn”, “event handler was called”);
Backendless.Data.of(“TestTable”).save(testMap);
Ok, I’ve got and tried it, but it worked for me.
I’m getting an exception while invoking, but it’s an expected exception.
Can you try to debug your custom code as described here: https://backendless.com/documentation/business-logic/java/bl_debugging.htm
Just put a breakpoint at the beginning of “beforeCreate” handler and try to invoke it, for example, from REST console.