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
Nikhil Garg 17Nikhil Garg 17 

visualForce using page reference

Hi,

I want to call the vf page using Page reference from my apex class to pass some data but don't want to open the vf page, and after getting the parameter this vf page is calling other apex class methods.
How can I reach this functionality?

Thanks
 
SwethaSwetha (Salesforce Developers) 
HI Nikhil,
To call a Visualforce page from your Apex class and pass data without opening the page, you can use the PageReference class in Salesforce. 

See Related:
https://www.forcetree.com/2009/06/passing-parameters-to-visualforce-page.html?m=1
https://stackoverflow.com/questions/8967807/how-do-i-call-a-vf-page-with-parameters-from-a-button-in-another-vf-page
https://salesforce.stackexchange.com/questions/35116/how-do-i-call-a-vf-page-with-parameters-in-a-unit-test


Thanks