r3
r3 copied to clipboard
Check for "any field changed" or "unsaved changes" in frontend
Is it possible to check if there are any unsaved changes in a form? I am using a custom frontend function that shouldn't be invokable if there are any unsaved changes, because the backend function it calls uses the data from the database. app.record_save() seems to be async without a callback, so I can't use it to force saving the changes before calling the backend function. There could be a timing problem.
At the moment I am using form state conditions but to add every field one by one is very time consuming and easy to forget if new fields get added.