Entity Listener

Hello,
In the most recent version of Cuba Platform i don’t have the option to create an Entity Listener in the Middleware section, instead i have the Event Listener but if i recall they aren’t the same thing.
I wanted to create an auto_increment using uniqueNumbersAPI and the onBeforeInsert, but in the Event Listener there isn’t any onBeforeInsert.
Thank you for your time.

image

EntityChangedEvent is now the recommended method, instead of the old Before/After Insert/Update/Delete Listeners.

If you want to use the old Entity Listener, you’ll have to write the code manually.

1 Like

Hi,
You can use EntityPersistingEvent instead of the onBeforeInsert entity listener:
https://doc.cuba-platform.com/manual-7.2/entityPersistingEvent.html

Thanks you, with your help i was able to make it work!