Skip to main content
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
Source Link

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya@Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.

For custom Visualforce Pages, the programmatic approach would be:

PageReference detail = Page.CaseDetail;
detail.getParameters().put('id', varCaseId);
return detail;

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.

For custom Visualforce Pages, the programmatic approach would be:

PageReference detail = Page.CaseDetail;
detail.getParameters().put('id', varCaseId);
return detail;

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.

For custom Visualforce Pages, the programmatic approach would be:

PageReference detail = Page.CaseDetail;
detail.getParameters().put('id', varCaseId);
return detail;
added 188 characters in body
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.

For custom Visualforce Pages, the programmatic approach would be:

PageReference detail = Page.CaseDetail;
detail.getParameters().put('id', varCaseId);
return detail;

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.

For custom Visualforce Pages, the programmatic approach would be:

PageReference detail = Page.CaseDetail;
detail.getParameters().put('id', varCaseId);
return detail;
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

The most proper way to construct a redirect PageReference is to use the StandardController.view method. In this case, you need to also construct the record itself with the varCaseId.

PageReference view = new ApexPages.StandardController(new Case(Id=varCaseId)).view();
return view;

You don't even need to cache it, I just do so here because I find it more illustrative. As @Ilya mentions in the comments, you want to replace return null with this at the end of your upload method.