Backendless Event Handler

82 Views Asked by At

screenshot

Good day all.

I am new and learning to code with backendless. Currently I am playing around to figure some things out, thats my way of learning. I went through the backendless missions as well.

Please see codeless logic as per picture. My goal is to write auto increment number. I know there are probably better ways, but would like to know why this isn`t working. I am sure thatll help me understand a lot more than just showing me the right way.

The idea of the logic above is to: BeforeCreate, get uniqueItemNumber from last record, +1 to that and then upload that with the new record. The table is "items"

If anyone can please tell me why it isnt working, Ill really appreciate it a lot!!

1

There are 1 best solutions below

0
On

You do not need to save the object in the before create event handler, all that's needed is to modify the object (which you already do). I recommend adding some logging (using the print block) and see if the event handler is executed. You can see the logs in the Real-Time Logging Window that can be launched directly from the Business Logic screen.

Alternatively, you could use the Backendless database feature for auto-incremented column values.