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
VenkataRajaVenkataRaja 

Pass the list variable into url. Can I pass It..

Hi,

 

      I have plan to pass the list variable into url.

 

Ex: List<Id> ids = new List<Id>();

 

Ids have some list of Ids.

 

public PageReference method(){

       PageReference pr = new PageReference('/VFPage?IdList='+ids);

       return pr;

}

 

can I use like this. And Can I use these list variable in VFPage page.

 

Regards

Venkat

firechimpfirechimp

Hi Venkat,

You could do it like this:

public PageReference method(){
       PageReference pr = Page.VFPage;
       pr.getParameters().put('IdList',String.valueOf(ids));
       return pr;
}

 

BUT I would adive against it since you will likely meet the max size of the URL.

 

What is your usecase for this? why can't you just share the controller between pages?