- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2020 03:02 AM
Hi all,
It seems like "action.setRedirectURL(url);" is not working for agent workspace.
Here is the error message shown in browser:
The script works in UI16, but not the case in agent workspace.
Anyone have ideas?
Regards,
Ming
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2020 05:22 AM
I think the issue here is you are trying to redirect to catalog UI Page from Agent Workspace which cannot be redirected.
1) You can convert the server code to client side and put it in a glideajax.
Here is a reference article:
2) Use client and server code in same UI Action:
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2020 03:06 AM
Can you try solution on this link:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2020 03:26 AM
Hi, thanks for the reply.
Your solution is client side script, actually the URL is set in server side script, do you mean I need to set the URL again in agent workspace script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2020 05:22 AM
I think the issue here is you are trying to redirect to catalog UI Page from Agent Workspace which cannot be redirected.
1) You can convert the server code to client side and put it in a glideajax.
Here is a reference article:
2) Use client and server code in same UI Action:
https://www.servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2020 09:14 PM
Thanks for you information.
Now my solution is:
For UI16, change server side to client side, script of main logic remains the same.
For Agent Workspace: use window.open() to go to new URL.