You need to sign in to do that
Don't have an account?
ABak
Passing Ids between visualforce pages.
I have a visualforce page with a standard controller set to a custom object. On click of a button on the page I am navigating to 2nd visualforce page. I would like to pass the 'Id' of the custom object to the second page. Any ideas on whats the best way to do that?
Oh so you're using an extension too? In that case it's easy, in your method that does this:
public PageReference standardPriceAddPage()
{ return Page.Add_Service_Standard_Price; }
Add this,
public PageReference standardPriceAddPage()
{
PageReference pr = Page.Add_Service_Standard_Price;
pr.put('id',serviceproduct.id);
return Page.Add_Service_Standard_Price;
}
Wes
All Answers
Hey
Could you post some code, there are ways to do it but it depends on exactly what you're trying to do.
Wes
Heres my first apex page.
On click of the button I want to switch to another page. the controller funciton for action on button
public PageReference standardPriceAddPage()
{ return Page.Add_Service_Standard_Price; }
Now I want to pass on the Id of the 'Service_Product__c' which is my custom object (hence the std controller) to the new page (which is 'Add_Service_Standard_Price') so that I can use DML on that new page.
Oh so you're using an extension too? In that case it's easy, in your method that does this:
public PageReference standardPriceAddPage()
{ return Page.Add_Service_Standard_Price; }
Add this,
public PageReference standardPriceAddPage()
{
PageReference pr = Page.Add_Service_Standard_Price;
pr.put('id',serviceproduct.id);
return Page.Add_Service_Standard_Price;
}
Wes