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

how to call visual page from another visual page
Hi all
I would like to call a visual page(AddCertifications) from another visual page(ProfileUpadate) in button click. But nothing is coming when i click the button.This is my code
PageReference p = new PageReference('/apex/AddCertifications?id='+cid);
p.setRedirect(true);
return p;
The requirement is when i click the upload button in ProfileUpadate page , the AddCertifications page will open for uploading file.Both the pages extends different controllor. How to achieve this one?
I would like to call a visual page(AddCertifications) from another visual page(ProfileUpadate) in button click. But nothing is coming when i click the button.This is my code
PageReference p = new PageReference('/apex/AddCertifications?id='+cid);
p.setRedirect(true);
return p;
The requirement is when i click the upload button in ProfileUpadate page , the AddCertifications page will open for uploading file.Both the pages extends different controllor. How to achieve this one?
Can you check the solution mentioned in the below stack exchange question. I hope you also have the similar requiremrnt.
https://salesforce.stackexchange.com/questions/117217/how-to-call-another-visualforce-page-from-an-apex-command-button
If this solution helps, please mark it as best answer.
Thanks,
Hi Ramya,
you have 2 options for this
1. using apex
PageReference pr = new PageReference('/apex/AddCertifications');
pr.getParameters().put('id',cid);
pr.setRedirect(true);
return pr;
2. using JS
<button onclick="window.location.href='/apex/AddCertifications?id={!cid}'; "> click </button>