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
Michael_MantouvalosMichael_Mantouvalos 

how to redirect to pageReference without the use of Visualforce page

Hello,

I am quite new to salesforce and I have a question about page redirection. I have created the following PageReference in Apex : 

 

PageReferenceIs there a way to navigate directy to the generated Url without the use of a visualForce Page? When I call this method, It doesn't do anything.

 

Thanks in advance!

 

 

ShirishaShirisha (Salesforce Developers) 
Hi Michael,

Greetings!

It depends on your requirement like,if you are trying to redirect to the direct page then you can use the link.Otherwise,you need to create the custom page(Lightning component/VF page) to redirect using the pageRedirect method.

Reference:https://stackoverflow.com/questions/9852020/pagereference-setredirect-is-not-working

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri