Disable dirty_form_support on specific page

mmcbride1007
Tera Contributor

We have dirty_form_support enabled but in one instance, we are submitting the record via AJAX and redirecting. When the page tries to redirect, our users are getting the "Are you sure you want to navigate away from this page?" dialog. In this instance, since we are submitting the information behind the scenes, we don't want that to run.

 

I've already tried adding a line to the UI Action to force the g_form property to be false, but that did not work (g_formDirtyFocus = false). Has anyone else successfully done this?

1 ACCEPTED SOLUTION

mmcbride1007
Tera Contributor

Looked through the code a little more and found out ServiceNow is checking for "!g_form.submitted && g_form.modified", so in my UI Action I set "g_form.modified = false" instead of "g_formDirtyFocus = false" and that solved the issue.


View solution in original post

1 REPLY 1

mmcbride1007
Tera Contributor

Looked through the code a little more and found out ServiceNow is checking for "!g_form.submitted && g_form.modified", so in my UI Action I set "g_form.modified = false" instead of "g_formDirtyFocus = false" and that solved the issue.