Redirect to a blank page

Pedro Nascimen1
Tera Contributor

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?

14 REPLIES 14

var urlDirect = "/" + current.sys_class_name + ".do?sys_id=" + current.sys_id;


current.update();


gs.log(urlDirect);


action.setRedirectURL(urlDirect);



This worked for me and above log printed -> /incident.do?sys_id=d1d0069bdb0903002f30f6dfbf9619e0




It prints the correct URL (/u_internal_change_request.do?sys_id=29bfea170f09cb007ef047ece1050e66), however when I click on the UI action it still redirects me to a blank page, I know it's weird, maybe the issue is related to the workflow? But I don't know why the workflow would make the UI action not redirect to the current record...


Govind Kumar S1
Kilo Guru

Hi Pedro,



I tried the UI actions provided OOB in change Mgmt "Request Approval"



https://<instance name>.service-now.com/sys_ui_action.do?sys_id=4a296773cb100200d71cb9c0c24c9c3f



This worked perfectly fine. Please compare



Hope this helps you.



Regards,


Govind Sharma


Pedro Nascimen1
Tera Contributor

Seems the problem is related, somehow, to the workflow.
I built a new workflow (much more simple than the one I already have) which is fired when I raise a new change but waits for a condition triggered by the UI action, and everything works well there, the page is redirected to the current record instead of the blank page.



I'll try to figure out what is happening in the workflow so the page is redirected to a blank one.


Pedro Nascimen1
Tera Contributor

Finally I was able to figure out the problem.


Seems the problem was related to the Approval Engines for my table.


http://wiki.servicenow.com/index.php?title=Approval_Engines#gsc.tab=0


The property should be set to "Turn off Engines" instead of "Approval Rules", because I have my own workflows to manage the approval process.



Am I right if I select this option instead the one I had before?


I'm a little bit afraid if this can cause some impact in the normal performance or behavior of the changes.