0

i have two pages ,in first page two input values is there from one object.while entering two values then clicks the button need to move another page and need to display the child records based upon parent record.how to pass two input values in url parameter and how to fetch the those url parameters in another page and display the records.can anybody help me on this.

2 Answers 2

1

Assuming those inputs are bound to controller fields called fieldOne and fieldTwo, in the action of a button in the main page:

 public PageReference goToAnotherPage() {
     PageReference pr = Page.AnotherPage;
     pr.getParameters().put('one', String.valueOf(fieldOne));
     pr.getParameters().put('two', String.valueOf(fieldTwo));
     return pr;
 }

and in the constructor of the AnotherPage controller:

 public with sharing class AnotherPageController {
     public AnotherPageController() {
         String one = ApexPages.currentPage().getParameters().get('one');
         String two = ApexPages.currentPage().getParameters().get('two');
         // Use the values here or assign to fields
     }
 }
0

Alternative - Is to use Flows instead of using visualforce pages. Reference Doc -https://help.salesforce.com/htviewhelpdoc?err=1&id=vpm_admin_flow_overview.htm&siteLang=en_US

1
  • @user if this ans solved your issue. the pls accept the ans and upvote. :)
    – Rachit
    Mar 18, 2016 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .