Disable alert "Changes you made may not be saved." for particular catalog form on Service Portal

Community Alums
Not applicable

Hello Developers,

We have requirement for Service Portal catalog form. We need to redirect from one form to another form without knowing the end user. If end user selects any particular value then form will redirect to another form but we are getting alert box -
"Changes you made may not be saved".  Thing is if they click on cancel, they will not redirect to another form and we want to prevent this case.                                                                                                                           

Is there anyway to disable this alert for particluar catalog form only.

find_real_file.png

 

Thanking you.

Regards,

Akshay

1 ACCEPTED SOLUTION

correct! so we cant say that it comes from browser level. 

although before redirecting we can use this code to avoid that popup.

top.window.onbeforeunload = null;

View solution in original post

25 REPLIES 25

Krishna  Penaka
Tera Expert

Hi,

g_form.modified=false;

in the script before redirecting to the other page.

 

Regards,

Krishna

 

Community Alums
Not applicable

Hello Krishana,

I have added g_form.modified = false; but not working.

 

Regards,

Akshay

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Akshay,

that is expected by design.

User has given some value and is moving away from the page the message comes from browser level.

how are you redirecting? is it via onchange client script on some variable

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

we can override this funtionality 
glide.ui.dirty_form_support : Alert user navigating away from a modified form, with option to cancel navigation.

Hi,

that system property is available but if that is updated it would be global impact throughout the instance

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader