Quote are nested in Transaction.
The problem was solved with an (After) Entity Listener but only for (Edit) existed transactions (already present in database).
For new Transaction (Quote) - that is not present in database, I think I have to use CreateAction class and DataManager interface in Transaction Browse Controller.
Do you have an example in this respect?
I think I have to use initNewItem (or postInit) method but I don’t know how.
What is difference between init and initNewItem? One is for Association and another one for Composition?
Apparently my case is like in init example.
The problem is that in Transaction-browse.xml I don’t have quoteDs datasource. Only in Transaction-edit.xml. But in TransactionEdit controller I dont’n have Transaction action. So I cannot use init with TransactionTableCreate…
On the other hand in initNewItem I cannot set Transaction only Quote.
init() is invoked every time the screen is shown. initNewItem() is invoked for editor screens when it is shown for a new entity instance. You can set attributes of the new entity in this method before showing it to the user.
In the new screen API, instead of the init() method subscribe to InitEvent and instead of initNewItem() subscribe to InitEntityEvent.
Unfortunately, I cannot decide for you how to initialize your entities. I think the cookbook examples demonstrate the possible solutions.