function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Smriti WadhwaSmriti Wadhwa 

How to call one visualforce page from another visualforce page?

I am trying to creating a link so that when a user clicks a text (which is a value of SObject), it opens a pop-window that opens a new visualforce page. 
I am new to Visualforce development, so I really appreciate any pointers/ideas on how to do this?
Best Answer chosen by Smriti Wadhwa
Akshay Dhiman 63Akshay Dhiman 63
Hi Smriti,

Find the sample code below to redirect from one vf page to another vf page.
<apex:page >
<script language="javascript" type="text/javascript">

function popitup(url) {
    newwindow=window.open(url,'name','height=200,width=150');
    if (window.focus) {newwindow.focus()}
    return false;
}
</script>
<apex:form >
<apex:CommandLink Value="Select Product" onclick="window.open('/apex/YOUR PAGE NAME')"/>
</apex:form>
</apex:page>

Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.
Thanks
Akshay

All Answers

Akshay Dhiman 63Akshay Dhiman 63
Hi Smriti,

Find the sample code below to redirect from one vf page to another vf page.
<apex:page >
<script language="javascript" type="text/javascript">

function popitup(url) {
    newwindow=window.open(url,'name','height=200,width=150');
    if (window.focus) {newwindow.focus()}
    return false;
}
</script>
<apex:form >
<apex:CommandLink Value="Select Product" onclick="window.open('/apex/YOUR PAGE NAME')"/>
</apex:form>
</apex:page>

Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.
Thanks
Akshay
This was selected as the best answer
Smriti WadhwaSmriti Wadhwa
This code was exactly what I was looking for. Thank you so much for your help.
Malika Pathak 9Malika Pathak 9
Hi Smriti Wadhwa,

Please Find the solution.I hope it will help you too
 
<apex:page >
    <apex:form>

        <apex:pageBlock>
            <apex:pageBlockSection>
                <apex:outputLink onclick="window.open('/apex/Q6V',
            'Popup','height=500,width=800,left=100,top=100,scrollbars=yes,toolbar=no,status=no');">
                    Go To Next Page
                </apex:outputLink>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
    </apex:form>
</apex:page>


window.open('URL',
'Popup','height=500,width=800,left=100,top=100,scrollbars=yes,toolbar=no,status=no');

If you feel  it will help you then  please mark best answer.