Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 03:47 AM
it worked for me in both native + workspace, see below I got info message present in server side both the times.
Script:
function showFunction() {
alert('inside normal client script');
var url = '/' + 'incident' + '.do?PDF&sys_id=' + g_form.getUniqueValue() + '&sysparm_view=workspace';
alert(url);
top.window.open(url, "_blank");
gsftSubmit(null, g_form.getFormElement(), "export_pdf");
}
if (typeof window == 'undefined')
runBusRuleCode();
function runBusRuleCode() {
gs.addInfoMessage('server side');
}
Workspace client script:
function onClick(g_form) {
var ans = confirm("Do you want to move ahead?");
if (ans == true) {
alert('inside workspace client script');
var url = '/' + 'incident' + '.do?PDF&sys_id=' + g_form.getUniqueValue() + '&sysparm_view=workspace';
alert(url);
open(url, "_blank");
g_form.submit(g_form.getActionName()); // matching the UI action name
}
}
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader