Getting previous child relationship data before saving the parent data.
Hi, i am trying to create a version control on a model.
Let's say i have a model called Assets, and Assets can have many different versions. Once a user click 'save' in the edit page, I used hooks in EditAssets to create an record in asset versions control table first, then only continue updating the model. However, i can't to seems to get the old child relationships' data, but the parent Model works fine as i can get it through
I have tried to get the old children relationships' data at afterValidate by calling but this will get the latest relationship data instead of the old / previous one.
Is this because the relationship was synced / save as soon as the 'save' button is clicked? If this is the reason, any way that i can get the old relationships data before saving it?
0 Replies