You need to sign in to do that
Don't have an account?
Would like to redirect user auotmaticalley into next page
HI ,
Can anyone help me out how to redirect user automatically into some other page ,when i click on redirect to account link.pageReference method will call and it will take me into account page , but i want to perform this action automatically.
Below is the my code.
<apex:commandLink value="Redirect to Account" style="color:blue; font-weight:bold;" action="{!RedirecttoAccount}"
rendered="{!Not(Display)}"/>
</center>
public PageReference RedirecttoAccount() {
PageReference Page = new ApexPages.StandardController(acc).view();
Page.setRedirect(true);
Return Page; }
write this on the page action
<apex:page action="{!redirect}">
</apex:page>
or you can run or call action function on window.onload
mark it helpful if it helps
@avijit Capgemini Developer
how to call action function on window load.
<apex:form>
<apex:actionFunction name="redirectToAccount" action="{!redirect}" />
</apex:form>
<apex:outputPanel rendered="{redirectRequired}" id="redirectPanel">
<script>
redirectToAccount();
</script>
</apex:outputPanel>
I have puted one extra variavle to redirect based in condition i.e when redirectRequired is true if you want it all the time then no need of rendered. If you want it all the time better to write in page action