External content by Sébastien Anselment, June, 2025;
Based on this forum entry (How to get "unsaved data" exists information aka "page is dirty") from Daniel Krüger this article describes how to disable the alert window if the form is dirty because it is containing unsaved data changes.
There may be use cases where one doesn't want to create an instance at all and so there is no need to save data nor to check if there is unsaved data. One use case would be the check if a user owns a valid driver licence (which is stored in other WF instances and information retrieved by a business rule).
To deactivate the "unsaved data" alert one can add a simple form rule to the desired process. Example:
//Switch for console.log output
const isDebug = false
function resetIsDirtyInSessionStorage(key = 'WebconBPS_FormIsDirty') {
//Get sessionStorage item
const raw = sessionStorage.getItem(key);
if (!raw) return;
//Parse object
const obj = JSON.parse(raw);
//Check if is Dirty is true and if yes set it back to false
Object.values(obj.mainPlaceholder).forEach(v => {
if (v.isDirty) v.isDirty = false;
});
//Write modified values to sessionStorage
sessionStorage.setItem(key, JSON.stringify(obj));
}
//Output values BEFORE manipulation to consoloe
if (isDebug) {
obj = JSON.parse(sessionStorage.getItem('WebconBPS_FormIsDirty'));
console.log(obj);
}
resetIsDirtyInSessionStorage();
//Output values AFTER manipulation to consoloe
if (isDebug) {
obj = JSON.parse(sessionStorage.getItem('WebconBPS_FormIsDirty'));
console.log(obj);
}
Then simply add this form rule to all places (style and behavior in fields, paths, ...) where you expect triggers which could lead to the"unsaved data alert.