So I have a VF page that is being used to override the Task View and Edit actions.

<apex:page standardController="Task" docType="html-5.0" readOnly="true"
<!-- do stuff here -->

The controller likes as follows:

private Task t;
public myControllerExt(ApexPages.StandardController stdController) {
    t = (Task)stdController.getRecord();

The problem is, that when I try to open up an archived task, I get an error as follows:

Data Not Available The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page.

I'm assuming it has something to do with the fact that this object needs to be queried using the ALL ROWS clause.


Thinking about it something like this should work:

private Task t;
public MDIController(ApexPages.StandardController stdController) {
    t = [SELECT Id FROM TASK WHERE Id =:ApexPages.currentPage().getParameters().get('id') ALL ROWS];

The only issue is that now you have to manually specify all the fields you need instead of letting them be inferred from what's referenced in the Visual Force page. It's a work around at best.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.