
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:03 PM
HI,
while using an ui action I face to strage issues:
1. the "action.setRedirectURL(current);" does not do its job - I always leave the form after the change is done ...
2. I'm using the g_form.submit(); as this one woks - using g_form.update(); also changes the value, but not actually saving it ...
function clickedReview() {
g_form.setValue('ifieldname',value);
g_form.submit();
action.setRedirectURL(current);
}
Any Hint on this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:06 PM
Hi Venffm,
This works in server side script of Ui Action.
Please move this to server side script and validate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2019 08:45 AM
Hi Sneha ,
will you be able to help me with this post i posted on community .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:14 PM
Hello Vemffm,
Please refer below blog and adjust your code accordingly.
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
Let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:27 PM
Hi vemffm
In addition to sneha's reply..
You need to use gsftSubmit for this purpose. Dont forget to add the Action name NOT the button name to the parameter.
function clickedReview() {
g_form.setValue('ifieldname',value);
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'close_incident'); //MUST call the 'Action name' set in this UI Action
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if(typeof window == 'undefined')
Current.update();
action.setRedirectURL(current);
}
More info here:
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/