Redirect to a blank page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 01:29 AM
Hello,
I've a UI action to request for approval after a normal change has been raised, of course when you raise a normal change a specific workflow starts and waits for that action to proceed.
The problem is when you request for approval it always redirects to a blank page.
This is the original code:
current.approval = "requested";
current.update();
action.setRedirectURL(current);
//action.setReturnURL(current);
I also tried a lot of different things, for instance:
var urlDirect = gs.getProperty("glide.servlet.uri") + "/nav_to.do?uri=" + current.sys_class_name + ".do?sys_id=" + current.sys_id;
current.approval = "requested";
current.update();
action.setRedirectURL(urlDirect);
//action.setReturnURL(urlDirect);
None of the approaches worked, always the same thing, it redirects to a blank page.
Any ideas or work around to solve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 01:38 AM
Hi Pedro,
Can you check the URL to which you are trying to redirect is formed correctly?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 01:42 AM
Hi Ankur,
Thanks for your answer.
Yes, I already did a gs.log(urlDirect) just to make sure the URL was being formed correctly and it is, I copied that and pasted that into the browser, opened the record without any problems.
Cheers,
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 03:06 AM
try below
- var urlDirect = "/" + current.sys_class_name + ".do?sys_id=" + current.sys_id;
- current.approval = "requested";
- current.update();
- gs.log(action); // see if action is available in the script
- action.setRedirectURL(urlDirect);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 03:12 AM
Hi Girish,
Thanks for your answer.
Didn't work, still redirects to a blank page.
gs.log(action) returned: com.glide.script.Action@1e47f67
Cheers,
Pedro Nascimento