I have an Apex controller which is exposed as REST API. In the above controller , there is page reference method.
Once the Page reference method gets invoked , Am passing the VF Page name and the Apex Page id in the below:
PageReference myVFPage = new PageReference('/apex/VFPageName=' + vfPageId);
myVFPage.setRedirect(true);
return null;
The page reference method is getting executed with no errors, however the VisualForce page name that was passed in the method is not loading. Please advice on how can the VF Page could be loaded.
PageReference
object in response to a REST API call does not perform a redirect on the remote caller, and Visualforce page controllers usually do not expose REST resources. Could you please provide more code context to help us understand what you are trying to do ?