You need to sign in to do that
Don't have an account?
Shirley Maglio
How to display the original Account detail page, after ovrriding the standard Delete button in a related list?
Hi All,
I have overridden Salesforce’s standard Delete button in a Related List of an Account detail page.
In order to override the standard Delete button, I have created a new Visualforce page with an Apex controller extension class.
How do I display the original Account detail page after I am done deleting?
Any help will be greatly appreciated!
Shirley
I have overridden Salesforce’s standard Delete button in a Related List of an Account detail page.
In order to override the standard Delete button, I have created a new Visualforce page with an Apex controller extension class.
How do I display the original Account detail page after I am done deleting?
Any help will be greatly appreciated!
Shirley
The relatedList delete will have retUrl=<ID> in the URL Query String.
Use this in your Custom delete method on the Apex controller extension class to create the pagereference and return that page reference.
String retUrl = ApexPages.currentPage().getParameters().get('retURL');
if (!String.isBlank(retUrl )) {
PageReference page = new PageReference('/' + retUrl);
page.setRedirect(true);
return page;
}
All Answers
var retUrl = '{!$CurrentPage.Parameters.retURL}';
The relatedList delete will have retUrl=<ID> in the URL Query String.
Use this in your Custom delete method on the Apex controller extension class to create the pagereference and return that page reference.
String retUrl = ApexPages.currentPage().getParameters().get('retURL');
if (!String.isBlank(retUrl )) {
PageReference page = new PageReference('/' + retUrl);
page.setRedirect(true);
return page;
}
Thank you very much for your help.
~Shirley