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
askask 

passing records using checkbox to next VF page

Hello,

 

I am new to salesforce and needed some help regarding passing records using checkbox to next VF page...

I have created a custom object with some text fields and i have created a VF page in which i have displayed these fields along with a checkbox.Its somewhat like a checkbox in a datatable kind of look.

Also i have created a wrapper class that holds the selected(checked) records.Now i want these checked records to be retrieved and displayed in the next VF page on passing it as a url parameter in page reference.

How is this done? Is there any other way of doing this apart from passing it as a url parameter.

Please help...

 

Thanks

NzgonNzgon

Use same controller on both pages.

Code your constructor method that do not initialize values for parameters that you want to pass (load of second page will make it null if you do not do it).

 

 

If (yourparameter==null){

yourparameter='default value';

}

 

Nash

askask

Thanks for your reply...In my case i am using two different controllers,so how do i proceed with it?

NzgonNzgon

In this case, save values in object and pass Id of saved record to second page. Use Id to query values to be used on second page.

 

Nash

askask

I have saved the selected records in the wrapper object and when i pass this wrapper object to next page,the whole record as well as the id of the record is getting passed.

something like this


https://c.ap1.visual.force.com/apex/pagename?value=%28Object__c%3A%7BName%3DABC%2C+Id%3Da0O90000001DDAgEAO%2C+Field__c%3D10.00%7D%29

 

so how do i retrieve the id seperately from this string to query the values?how do i query for multiple ids?