APEX: Warn on Unsaved Changes

When an user makes a change to a form (ex: updates their phone number) and tries to navigate away (ex: hit back button, close tab, etc) without saving their changes they’ll get the following warning message: This page is asking you to confirm that you want to leave - data you have entered may not be saved.

To configure this option at a page level modify the page attribute Warn on Unsaved Changes

In some cases some page items will be changed but users shouldn’t be warned about them. Usually these are items that you have to store “temporary data” to be used in Dynamic Actions. To ignore these page items from change warnings, modify the page item and set its Warn on Unsaved Changes:

Follow up article: How to Find Which Item has Been Changed in APEX