action redirect in UI Action for workspace

PhoenixMing0912
Giga Expert

Hi all,

It seems like "action.setRedirectURL(url);" is not working for agent workspace.

Here is the error message shown in browser:

find_real_file.png

The script works in UI16, but not the case in agent workspace.

Anyone have ideas?

 

Regards,
Ming

1 ACCEPTED SOLUTION

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:

https://community.servicenow.com/community?id=community_question&sys_id=96e0bb35dbec3b405ed4a851ca96...

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/

View solution in original post

7 REPLIES 7

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?

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:

https://community.servicenow.com/community?id=community_question&sys_id=96e0bb35dbec3b405ed4a851ca96...

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/

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.