Redirect to Previous Page in Client Script

dalton1
Giga Expert

Hi,

I would like to ask how to redirect the user to a previously visited page after click of Submit. Code will be put in the client script. I have tried below option but to no avail:

- action.setReturnURL(current);

Any suggestions?

9 REPLIES 9

PrashantLearnIT
Tera Sage

Hi



Use



action.setRedirectURL(previous);


Thanks


Prashant


I don't think there is a "previous" if you're coming from a list view and not a form.


Out of box on incident table when clicking on Submit you get redirected automatically to last visited page/list view/etc.



This is the content of Submit UI action for incident table which uses script includes ActionUtils:



answer = current.insert();


gs.include('ActionUtils');


var au = new ActionUtils();


au.postInsert(current);



Regards,


Sergiu


HI sergiu.panaite and prashant0007,



I cannot use the action, previous, current and gs objects since I need to code in the client script. Are there any alternatives available for this?


Kalaiarasan Pus
Giga Sage

Try window.location.href