My question is i have button when click on new opportunity button new page of opportunity should open on which i need to fill details and when i will click on save button it will take redirect to the list page of opportunity where i can edit and delete record that i created .So i am using standard controller on second page for opportunity input and when click on save Opportunity detail page is open what should i do to redirect it to a list page of Opportunity with standard controller.

  • Are you using standard save method? In this case you need extension with custom save method. Feb 19, 2018 at 12:35

1 Answer 1


public PageReference save() {
Schema.DescribeSObjectResult result = oppurtunity.SObjectType.getDescribe();
PageReference pageRef = new PageReference('/' + result.getKeyPrefix());
return pageRef;

You must log in to answer this question.

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