how do acces the current object created in the afterInsert trigger of the domain?
eg.
I want to keep the id of object created in some other domain after the object is created
I have a domain order whose status is going to change a various number of time.
I want this changes to be recorded in other domain order history.
in order domain I wrote hasMany[orderHistory:orderHistory]
in the orderHistory domain i wrote belongsTo = [order:order]
But the orderHistory is coming common to all ie. each order is not having just their record but recoreds of all orders are being shown
If you need the id of the created instance just use
this.id.