You need to sign in to do that
Don't have an account?

back button which redirects to previous page
Hi,
How to redirect to the previous page from current page(the page which has got by clicking a button/link in the previous page) through javascript.
I tried by using window.location(-1) and history.goback(-1). These are not working..
I don't want to specify the path of previous page in the action back button/link. Because the same page is used by two different roles and thier previous pages are different.
please help me.........
Try using the following :
1. Window.history.go(-1)
2. Window.history.previous()
Hope this helps.
Hi Pradeep,
Thanks for your reply. Can U explain where I could use these javascript functions.
I am using it in the below tag. its not working.
<apex:commandlink value="back" onclick="window.history.go(-1)"/>
or
<apex:commandlink value="back" onclick="window.history.previous()"/>
I have the same question which i need to resolve.
Please help me..
Could you explain your problem?
If possible post your code.
Regards,
Shravan
Hi
I put a command button like this
<apex:commandButton value="Back" onclick="window.history.go(-2)"/>
This is working perfectly in mozilla firefox now but not working in chrome browser..
Anu
Once, we click the button, the status field should change to closed and the window needs to be closed automatically.
I have create the custom button and Using below OnclickJavascript.
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var qr = sforce.connection.query("SELECT Id, Status FROM Case where Id='" + "{!Case.Id}" + "'");
var records = qr.getArray("records");
var o = new sforce.SObject("Case");
o.id = "{!Case.Id}";
o.Status = "Closed";
sforce.connection.update([o]);
window.parent.close();
But the above code working in IE and Chrome but not working in Mozilla.Is there anyway to implementing the above functionality.
Thanks