+ Start a Discussion
hisrinuhisrinu 

How to redirect to VF Page from S-Control

I have a list button, on click of it I am sending the selected records IDs to the apex class by using the s-control.

In that apex class I am getting these rows, I want to display these records in that VF, how can I redirect it to VF.

When I am redirecting using s-control view state is getting refreshed,So I am not getting any records.

If I am trying to return through webservice method it is showing an error like  Invalid return type: System.PageReference

Best Answer chosen by Admin (Salesforce Developers) 
dchasmandchasman
Please read the doc for the Standard List Controller here (added in Winter '09) and the correct way to wire up a VF page as the target for a list button and leave that scontrol behind asap.
Message Edited by dchasman on 01-23-2009 11:15 AM

All Answers

Sam.arjSam.arj

Hi,

I suggest directing the user to your Visualforce page from your s-control (with passing the ID). Then you can pass the id down to your apex class within the Visualforce Controller to get the results and show them in the interface.

 

Would that work for you?

dchasmandchasman
Please read the doc for the Standard List Controller here (added in Winter '09) and the correct way to wire up a VF page as the target for a list button and leave that scontrol behind asap.
Message Edited by dchasman on 01-23-2009 11:15 AM
This was selected as the best answer
hisrinuhisrinu

Hi Sam,

 

Thanks for your reply.

I need to pass list of ids not the one id, in this case I have to go for s-control or I have to see the list controllers specified by Doug.

 

Thanks for your reply Doug, I will check it out.

hisrinuhisrinu

Hi Doug,

 

 Using the Standard List Controller, I am able to display them in the page but how do I use that selected records in the controller(Extension). From this page I want to save these records in another object, so can you please point me to the right direction.

hisrinuhisrinu

Hi Doug,

 

 I figured out, thanks for your help.