How to prevent reloading the page multiple times in workspace
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi,
I am using the below server script and client script within UI action, is there a way I can prevent reloading the page multiple times. Actually want to reload only when first if statement is true.
Thanks,
Server script:
var util = new KeywordRoutingUtil();
var result = util.evaluateRouting(current);
if (result.abort) {
gs.addErrorMessage(result.message);
gs.setRedirect(current);
} else {
//current.update();
gs.setRedirect(current);
current.insert();
}Client Script:
function onClick(g_form) {
g_form.submit('save_action');
g_form.reload();
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Kiran29
Can you try replacing g_form.reload() by reloadWindow(window) as per following post :
https://servicenowguru.com/client-scripts-scripting/reload-form-related-list-client-script/
