- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2020 01:55 AM
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.
Thanking you.
Regards,
Akshay
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2020 04:54 AM
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2021 04:33 AM
try this
function onSubmit() {
//Type appropriate comment here, and begin script below
var num = g_form.getValue("number");
if(num) {
//g_form.submit();
top.window.setTimeout(redirectUrl,1000);
}
function redirectUrl() {
top.window.onbeforeunload = null;
top.window.location = "https://digitalenergydev.service-now.com/sn_customerservice_l3_case_type.do?sysparm_query=number=" + num;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2021 04:49 AM
Thanks a lot for your reply Hammad.
The redirection is working fine, but before redirection it is giving this popup alert, I have to click on Leave and then only it submits the form and takes me to correct redirection.
How can I solve this? We want redirection to happen directly without any alert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2021 07:03 AM
I tried the above code and its not showing any popup for me.
please contact me here
+923063231735 WhatsApp
email:hammad702@gmail.com
we can further discuss.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 09:13 AM
Hi Hammad,
Where do we need to add this?
Regards,
Rushi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2020 06:06 AM
Hello Ankur,
Yes, I am redirecting by using Catalog On change Client script. I tried by clearing values and setting to Old value but it is not working on Service Portal. It's working on native.
Thanks & Regards,
Akshay