Feature Coverage: Confirmation when navigating away in a Record Producer

The Fruition Partners team faced yet another customization issue. 😉 or to put it in other words: how to help not losing your information while multitasking if you mistakenly navigate away from a page?

Record Producers are a very convenient way to ask users to fill-in a form. They offer many possibilities: among them, the possibility to display explanations for each field, make fields mandatory or read-only, and even script the behaviour of the information to be entered (e.g.: a field becomes visible only when a specific value is selected in a drop-down list). However, it can be very frustrating to spend a lot of time filling a Record Producer, and navigating mistakenly away from the page causing the loss of all the information you just seized.

The solution Fruition Partners came up with, was to create a script that displays a confirmation message to the user. If s/he tries to navigate away from the Record Producer and some modifications have not been submitted yet, the script runs and the confirmation message appears drawing attention to what you are about to do (or loose).

It can be easily used in multiple Record Producers (no code duplication) and is smart enough to let the administrator decide which fields are important and should be checked when leaving the page.

The gain: No more fear of losing data (and time)! When the user tries to navigate away from the page (typically when clicking by mistake on some link), s/he will get a confirmation message and have the possibility to stay on the page, and therefore submit the record (exactly as in a standard Service-now.com form when the “glide.ui.dirty.form_support” System Property is enabled).

Simply powerful!

Here is an example of Catalog Client Script to achieve the check described in the article above. Please note that each Variable of the Catalog Item/Record Producer must be checked individually (the example below has three Variables; each “<variableX>” tag must be replaced by the real Variable name).