Best way to create a record when another record

Hi there. I need to create a record every time another record in a different table is changed.

I can’t use the EntityChangedEvent stuff because I need access to the information in the changed record before it is committed, and the old value in the changed record.

So I went with Entity Listeners, which I reckon will do what I want. The only thing troubling me is the lack of support in the studio. I think we used to be able to create entity listeners, but it looks like this might have been removed from Version 7+. Is this because it is no longer recommended to use them?

Hi,

In CUBA Studio we support Event Listeners and Lifecycle Callback code generation. For your case, you can have a look at transaction listeners. They are supported in CUBA, so feel free to try them.

1 Like