
Hello,
On save of an entity record, I want to Change the form,
On save I'm calling this code :
function Onsavefunction(formcontext) {
....
formcontext.data.save().then(navigateToForm(formcontext));
}
function navigateToForm(formcontext) {
formcontext.ui.formSelector.items.get("f8123170-c691-40c1-9366-cdfe09c3cb61").navigate();
}
The problem is that I get pop up un unsaved changes message to the user. How do I ensure the save completes first and the popup doesn't occur?
It seems like the call the Navigate is done before the save button, even if it's called in "then"
Any Ideas ?
thanks
HI,
I would recommend to write this logic on modifiedon field change. Keep modified on field on the form and hide that field. Now add event handler on modified on field.
Please mark my answer verified if I were helpful!