
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015 04:12 AM
I have set-up a redirect from an on-submit client script but I need to save the form before I redirect, currently this just hangs.
Here is my client script...
function onSubmit() {
if(g_form.getValue("assignment_group") == "a4429af10a0a3c2800b1bc67f7b415c0" && (g_form.getValue("incident_state") == 6 || g_form.getValue("incident_state") == 7)){
gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');
var URL = "<my_url>.do?uri=u_sys_eng_questionnaire.do";
alert("You are being redirected to the Systems Support Questionnaire");
top.window.location = URL;
}
Can anyone suggest why this hangs and/or a better way to do this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015 07:09 AM
Talking about the UI action made me think why don;t I do this in the UI Action rather than a client script so I've done this ...
if(current.assignment_group != "a4429af10a0a3c2800b1bc67f7b415c0" && (current.incident_state != 6 || current.incident_state != 7)){
action.setRedirectURL(current);
current.update();
}
else{
var URL = "https://enxdev.service-now.com/nav_to.do?uri=u_sys_eng_questionaire.do";
action.setRedirectURL(URL);
current.update();
}
Which works however it loads like this ...
How can I get this to load just as the page I want and not with the banner and side bar duplicated?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015 04:14 AM
Check the code of this button with the actionname 'sysverb_update_and_stay'.. I think that's update UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015 04:27 AM
I think that maybe the issue I'm calling the update and it calls this script again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015 05:51 AM
Between what is the code on the update button ? Just the out of the box current.update()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2015 06:23 AM
My UI Action "Save" does this
action.setRedirectURL(current);
current.update();