You need to sign in to do that
Don't have an account?
believe
Invoke visualforce page in Apex?
Anyone knows how to invoke a visualforce page in Apex code without using callout (which requires you to setup the remote site)? Essentially I just want to make a 'local' http request.
do u want to invoke the vf page with in the same organization then u can do like this
pagareference pf = page.vfpagename;
Hi believe,
I guess you want the content of a vf page. This can be done with a pageReference method 'getContent'
There are some limitations around the 'getContent' method so have a look if you can achieve what you need: SF PageReference Documentation
Hope this helps!
Florian
Thanks for the reply. Unfortunately this is not allowed in Apex batch (which is what I really need).
What do you need from it? You can parse out what you need if you query for the ApexPage in SOQL.
What I want is to reuse the logic (formatting) in the visualforce page in Apex batch class. The visualforce page returns an excel file (or really html) so it builds all the cells with width, color etc. I want to store the same content in a file but in Apex batch. And I am try to avoid replicate all that code.