Skip to main content

I am getting error stating

'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 have found through searching that salesforce archives events older than 365 days, Now how to get all archived and not archived data? 

 

VF page code:

<apex:page standardController="Event" extensions="Visit_Notes_VFC" sidebar="false" doctype="html-5.0">

<style type="text/css">

body {background: #F3F3EC; padding-top: 15px}

</style>

<apex:form id="mainform">

<apex:pageMessages ></apex:pageMessages>

<apex:outputPanel>

<apex:outputLabel value="Notes" for="tts_notes" style="font-weight:bold;margin-right:14%;color:#4a4a56;vertical-align:top;" />

<apex:inputTextarea id="tts_notes" value="{!visObj.Notes__c}" rows="5" rendered="{!event.Visit__c !=null}" label="Notes"

style="text-transform:uppercase;margin-left:1%;width:60%;overflow:hidden;border-style: none;" html-maxlength="20000" >

<apex:actionsupport event="onchange" action="{!Savevisit}" rerender="mainform" rendered="{!event.Visit__c !=null}"></apex:actionsupport>

</apex:inputTextarea>

</apex:outputPanel>

<br/>

<br/>

<apex:outputPanel >

<apex:outputLabel value="Previous Notes" for="tts_prevnotes" style="font-weight:bold;margin-right:10.3%;color:#4a4a56;vertical-align:top;" />

<apex:inputTextarea id="tts_prevnotes" value="{!event.visit__r.Previous_Notes__c}" rows="5" rendered="{!event.Visit__c!=null}" label="Notes"

style="margin-left:1%;width:60%;overflow:hidden;border-style: none;" readonly="true" />

</apex:outputPanel>

<br/>

<br/>

</apex:form>

</apex:page>

Extension code:

public class Visit_Notes_VFC{

 

private final Event eveObj;

public Visit__c visObj{get;set;}

public Visit_Notes_VFC(ApexPages.StandardController stdController) {

this.eveObj = (Event)stdController.getRecord();

if(eveObj.visit__c!=null){

visObj = VistAudit_Modal.getNotes(eveObj);

System.debug(visObj);

}

}

public PageReference Savevisit(){

System.debug(visObj);

update visObj;

return null;

}

}

In this code values entered in VistAudit_Modal are stored in Note__c field. Values of Notes__c and Previous_Notes__c are displayed in VF page. Those fields are in Visit__c object which have lookup relationship with Event object. I tried SOQL query in query editor of debug log: SELECT Visit__r.Notes__c FROM Event WHERE Id = '00U1q000003sWnLEAU' ALL ROWS and SELECT Visit__r.Notes__c FROM Event ALL ROWS but getting error parsing query. I can get all data only through workbench after selecting 'include deleted and archived data'. 

So what changes should I make in code to show all records on vf page?

4 respostas
  1. 28 de dez. de 2022, 10:05

    Hi @Raj Duari, I tried 'ALL ROWS' in developer console's query editor but, getting error while parsing query. I tried same in apex class also still, I'm not getting the archived events.

0/9000