function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MaxaMaxa 

Task disappear

HI,I'm not sure if anyone else had similar problem, but few of our sales reps complained that their task disappear after a while, they pretty sure they log it its their under account but then after a while it's gone, strangely it happens to almost all of them, any one knows the reason? i looked at recycle bin it's not there, i even looked thru backups i do regularly its also done not have any records of any task created, I have already contacted support about this just wondering if anyone else had similar issue.  Max

 

JimRaeJimRae

According to the online help:

 

Salesforce.com archives older activities according to the conditions below:

  • Events with a due date greater than 365 days old
  • Closed tasks with a due date greater than 365 days old
  • Closed tasks without a due date that were created more than 365 days ago

Archived activities can be viewed only in export files, printable view, or by clicking View All on the Activity History related list.

Administrators can delete archived activities using Mass Delete.

Archived tasks are not included in reports. However, you can report on open or completed tasks.

 

MaxaMaxa

those task where created less than 90 days ago started around mid september,

there is no even a  function for view all under related list there is no activities, and field last activity is blank.

 

atlantisatlantis

As it says, Archived activities can be viewed only in export files.

 

But i wonder how to export these activities into file if we cannot see all of them at one place.

 

I use Apex Data loader and Apex Explorer, still not find these activities.

I have no idea where to export them.

 

 

Any guy has good idea?

MaxaMaxa

you need to ask Salesforce support to extend teh archive date i made mine 800 days

cgoitiacgoitia

I have about 5 sales users with similar problem. They create team sales calls or meetings,and their meeting notes in descriptions dissappears. I've had case open for two months now. Help! I'm very frustrated.

Frank ChangFrank Chang

@cgoitia, were you able to find a resolution to this situation?

Thanks,

Frank

SupernitramSupernitram
Hi @Maxa,
Did you find a way at the end to get them back ??
thanks
@Martin
Salvatore CarusoSalvatore Caruso
Hello, 
Same issue here; all the tasks disappeared from the related list of a few user profiles' homepage . Some users with the same profile are able to see all the tasks (overdue, today etc.); I have checked the recyble bin (empty) and the object access to activites...anywhere else possible. No clue on the reason of the issue. 

Please, please advise 
David Roberts 4David Roberts 4
I wasn't happy with the "View All" functionality and having to view archived activities in classic so I created this component bundle: I added it to the contact page.
Older events and task:
 
Controller
 
public class ArchivedEventsListController {
   
    @AuraEnabled
    public static List<Event> getArchivedEvents(Id theContactId) {
        List<Event> eventList = new List<Event>();
        system.debug('theContactId = '+theContactId);
        Date thePast = system.today();
        thePast = thePast.addYears(-1);
        eventList = [SELECT isarchived,Id,whoId,who.name,type,activitydate,startdatetime,subject FROM Event  WHERE (activitydate <= :thePast  and isdeleted = false and whoId = :theContactId) order by activitydate ALL ROWS];
        system.debug('theEvents size = '+eventList.size());
        system.debug('theEvents = '+eventList);
        return eventList;
                }//getArchivedEvents
   
    @AuraEnabled
    public static List<Task> getArchivedTasks(Id theContactId) {
        List<Task> taskList = new List<Task>();
        Date thePast = system.today();
        thePast = thePast.addYears(-1);
        //system.debug('theContactId = '+theContactId);
        taskList = [SELECT isarchived,Id,whoId,who.name,activitydate,subject from Task  where (activitydate <= :thePast  and isdeleted = false and whoId = :theContactId) order by activitydate ALL ROWS];
        //system.debug('theEvents size = '+taskList.size());
        //system.debug('theEvents = '+taskList);
        return taskList;
                }//getArchivedTasks
 
}//getArchivedTasks
 
 
Test class
 
@isTest(SeeAllData=false)
private class TestArchivedEvents {
   
    public static List<Event> eventsList;
    public static List<Task> tasksList;
   
    static testMethod void test() {
       
        //create campaign so that trigger default campaign works on insert event
        Contact theContact;
                                theContact = new Contact(firstname = 'Bill', lastname =  'Murray');
        insert theContact;
               
                //create some events and tasks to test...
               
                init(theContact);
        Test.startTest();
        
       
        eventsList = ArchivedEventsListController.getArchivedEvents(theContact.Id);
        system.debug(eventsList);
        tasksList = ArchivedEventsListController.getArchivedTasks(theContact.Id);
        system.debug(tasksList);
     
        Test.stopTest();
       
    }//test
   
   
    static void init(Contact theContact){
      
                                Event testEvent1 = new Event();
        testEvent1.Subject = 'Some training';
        testEvent1.StartDateTime=system.today()-365-365;
        testEvent1.EndDateTime=system.today()-365 -365+5;
        testEvent1.Trigger_Reminder__c = false;
        insert testEvent1;
       
        Task testTask1 = new Task();
        testTask1.Subject = 'Call';
        testTask1.ActivityDate=system.today()-365-365;
        insert testTask1;
       
       
  
                }//init
   
 
 
}//TestArchivedEvents
 
Component Bundles:
 
ArchivedEvents.cmp
 
<aura:component implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes"
                controller="ArchivedEventsListController"
                access="global">
   
   
   
    <!-- Handle component initialization in a client-side controller -->
    <aura:handler name="init" action="{!c.doInit}" value="{!this}" />
<!--<aura:attribute name="recordId" type="String" />-->
    <!-- Dynamically load the list of events -->
 
 
                <!-- attributes used to send EventId to row in list -->
                <!--<aura:attribute name="theEvent" type="Event"/>-->
    <aura:attribute name="theEventList" type="Event[]" />
    <aura:attribute name="theTaskList" type="Task[]" />
   
                <aura:attribute name="totalEvents" type="Integer" default="200"/>
    <aura:attribute name="totalTasks" type="Integer" default="0"/>
    <aura:attribute name="message" type="String"/>
 
 
 
<!-- Remember - Case sensitive field names -->
 
 
    <!-- PAGE HEADER -->
   
<lightning:layout class="slds-page-header slds-page-header--object-home">
   
    <lightning:layoutItem>
            <lightning:icon iconName="standard:scan_card" alternativeText="All Activities"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
           
       
    <div class="slds-page-header" role="banner">
      <div class="slds-grid">
        <div class="slds-col">
 <!-- debug title ...<p class="slds-text-heading**label">Contacts 26-06 15:05</p>    -->
      <!--    <h1 class="slds-text-heading**medium">#Names = {!v.totalContacts}</h1>
                <h1 class="slds-text-heading**medium">Message = {!v.message} Id{!recordId}~~</h1>
               <h1 class="slds-text-heading**medium">recordId = {!v.recordId}~~</h1>-->
            <h1 class="slds-text-heading--medium">Older Activities; Events = {!v.totalEvents} Tasks = {!v.totalTasks}</h1>
 
        </div>
      </div>
    </div>
    </lightning:layoutItem>
        </lightning:layout>
    <!-- / PAGE HEADER -->
 
    <lightning:layout>
<table class="slds-border--left slds-border--top slds-border--right slds-border--bottom slds-table slds-table_bordered slds-table_striped slds-table_cell-buffer">
 
<thead>
        <tr class="slds-text-title_caps">            
            <th scope="col"><div class="slds-truncate" title="Link">Link</div></th>            
            <th scope="col"><div class="slds-truncate" title="Date">Date</div></th>           
            <th scope="col"><div class="slds-truncate" title="Subject">Subject</div></th>
        </tr>
     </thead>
 
  <tbody>
 
      <h1 class="slds-text-heading--medium">#Events = {!v.totalEvents}</h1>
                <aura:iteration  items="{!v.theEventList}" var="varEvent">
        <c:ArchivedEventItem theEvent="{!varEvent}"/>
                </aura:iteration>
  </tbody>
   
<tbody>
       <h1 class="slds-text-heading--medium">#Tasks = {!v.totalTasks}</h1>   
      <aura:iteration  items="{!v.theTaskList}" var="varTask">
        <c:ArchivedTaskItem theTask="{!varTask}"/>
                </aura:iteration>
    
 
  </tbody>
   
</table>
  
  
    </lightning:layout>
</aura:component>
 
ArchivedEventsController.js
 
({
                doInit : function(component, event, helper) {
        
        helper.loadEvents(component);
        helper.loadTasks(component);
       
       
                },
})
 
ArchivedEventsHelper.js
 
 
({
                loadEvents : function(cmp) {
       //var baseURL  = cmp.get("c.getURL");
       //baseURL = URL.getSalesforceBaseUrl().toExternalForm();
      
      
       cmp.message = 'Hello';
       var recId = cmp.get("v.recordId");
       console.log('loadEvents recId = '+recId);
       
       
       if (recId) {
           var theAction = cmp.get("c.getArchivedEvents");
           theAction.setParams({
                "theContactId": recId
            });
            console.log('action set callback recId = '+recId);
          
           theAction.setCallback(this, function(response) {
              
               var state = response.getState();
               if (state === "SUCCESS") {
                   cmp.set("v.theEventList", response.getReturnValue());
                   //this.updateTotal(cmp);
                   cmp.set("v.totalEvents", response.getReturnValue().length);
                   console.log('success '+response.getReturnValue().length);
               }
               else {
                   console.log("Failed with state: " + state);                 
               }//endif
 
              
            });//theAction.setCallback
            $A.enqueueAction(theAction);
          
        }//if (recID)
           
        
    },//loadEvents
   
    loadTasks : function(cmp) {
       //var baseURL  = cmp.get("c.getURL");
       //baseURL = URL.getSalesforceBaseUrl().toExternalForm();
      
      
       cmp.message = 'Hello';
       var recId = cmp.get("v.recordId");
       //console.log('loadTasks recId = '+recId);
       
       
       if (recId) {
           var theAction = cmp.get("c.getArchivedTasks");
           theAction.setParams({
                "theContactId": recId
            });
            console.log('action set callback recId = '+recId);
          
           theAction.setCallback(this, function(response) {
              
               var state = response.getState();
               if (state === "SUCCESS") {
                   cmp.set("v.theTaskList", response.getReturnValue());
                   //this.updateTotal(cmp);
                   cmp.set("v.totalTasks", response.getReturnValue().length);
                   //console.log('success '+response.getReturnValue().length);
               }
               else {
                   console.log("Failed with state: " + state);                 
               }//endif
 
              
            });//theAction.setCallback
            $A.enqueueAction(theAction);
          
        }//if (recID)
           
       
    },//loadTasks
    
      
})
 
ArchivedEventItem.cmp
 
<aura:component>
   
    <aura:attribute name="theEvent" type="Event"/>
    <aura:attribute name="message" type="String" default="nothing"/>
   
    <!-- case sensitive names!!!-->
   
      <tr data-label="events">
 
  <td data-label="Id">
      <div class="slds-truncate" title="Id"><a class="slds-text-link" href="{!'/apex/Classic_Event?id='+v.theEvent.Id}">{!v.theEvent.Id}</a>
            </div>
      </td>
         
      <td data-label="Date">
        <div class="slds-truncate" title="Date">{!v.theEvent.ActivityDate}
            </div>
      </td>
      
          <!--<div class="slds-col" ><a class="slds-text-link" href="{!'/lightning/r/Asset/'+v.theAssetItem.Id+'/view'}">{!v.theAssetItem.Name}</a></div>
-->
         
                                <th scope="row" data-label="Subject">
            <div class="slds-truncate" title="Subject">{!v.theEvent.Subject}
           
            </div>
      </th>
 
  
    </tr>
 
</aura:component>
 
ArchivedTaskItem.cmp
 
 
<aura:component>
   
    <aura:attribute name="theTask" type="Task"/>
    <aura:attribute name="message" type="String" default="nothing"/>
   
    <!-- case sensitive names!!!-->
   
      <tr data-label="tasks">
 
  <td data-label="Id">
      <div class="slds-truncate" title="Id"><a class="slds-text-link" href="{!'/apex/Classic_Task?id='+v.theTask.Id}">{!v.theTask.Id}</a>
            </div>
      </td>
         
      <td data-label="Date">
        <div class="slds-truncate" title="Date">{!v.theTask.ActivityDate}
            </div>
      </td>
         
                                <th scope="row" data-label="Subject">
            <div class="slds-truncate" title="Subject">{!v.theTask.Subject}
           
            </div>
      </th>
 
  
    </tr>
 
</aura:component>
 
harnessApp.app
 
<aura:application access="GLOBAL" extends="force:slds">
          <c:ArchivedEvents recordId="0038E00000OE4JJQA1"/>
</aura:application>
 
Classic_Task.vfp
 
<apex:page standardController="Task">
    <apex:detail />
</apex:page>
 
Classic_Event.vfp
 
<apex:page standardController="Event">
    <apex:detail />
</apex:page>
David Roberts 4David Roberts 4
I then added a version for the Account:

ArchivedActivitiesOnAccount bundle...

ArchivedActivitiesOnAccount.cmp

<aura:component implements="force:appHostable,force:hasRecordId,flexipage:availableForAllPageTypes"
                controller="ArchivedEventsListController"
                access="global">
    
    
    
    <!-- Handle component initialization in a client-side controller -->
    <aura:handler name="init" action="{!c.doInit}" value="{!this}" />
<!--<aura:attribute name="recordId" type="String" />-->
    <!-- Dynamically load the list of events -->


    <!-- attributes used to send EventId to row in list -->
    <!--<aura:attribute name="theEvent" type="Event"/>-->
    <aura:attribute name="theEventList" type="Event[]" />
    <aura:attribute name="theTaskList" type="Task[]" />
    
     <aura:attribute name="totalEvents" type="Integer" default="200"/>
    <aura:attribute name="totalTasks" type="Integer" default="0"/>
    <aura:attribute name="message" type="String"/>
 
 
 
<!-- Remember - Case sensitive field names -->


    <!-- PAGE HEADER -->
    
<lightning:layout class="slds-page-header slds-page-header--object-home">
    
    <lightning:layoutItem>
            <lightning:icon iconName="standard:scan_card" alternativeText="All Activities"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            
        
    <div class="slds-page-header" role="banner">
      <div class="slds-grid">
        <div class="slds-col">
 <!-- debug title ...<p class="slds-text-heading**label">Contacts 26-06 15:05</p>    -->
      <!--    <h1 class="slds-text-heading**medium">#Names = {!v.totalContacts}</h1> 
    <h1 class="slds-text-heading**medium">Message = {!v.message} Id{!recordId}~~</h1>
                <h1 class="slds-text-heading**medium">recordId = {!v.recordId}~~</h1>-->
            <h1 class="slds-text-heading--medium">Older Activities; Events = {!v.totalEvents} Tasks = {!v.totalTasks}</h1>

        </div>
      </div>
    </div>
    </lightning:layoutItem>
        </lightning:layout> 
    <!-- / PAGE HEADER -->

    <lightning:layout>
    <table class="slds-border--left slds-border--top slds-border--right slds-border--bottom slds-table slds-table_bordered slds-table_striped slds-table_cell-buffer">
  
    
    <thead>
        <tr class="slds-text-title_caps">            
            <th scope="col"><div class="slds-truncate" title="Link">Link</div></th>            
            <th scope="col"><div class="slds-truncate" title="Date">Date</div></th>           
            <th scope="col"><div class="slds-truncate" title="Subject">Subject</div></th>
        </tr>
     </thead>
    
  <tbody>

      <h1 class="slds-text-heading--medium">#Events = {!v.totalEvents}</h1>
    <aura:iteration  items="{!v.theEventList}" var="varEvent"> 
        <c:ArchivedEventItem theEvent="{!varEvent}"/>
    </aura:iteration> 
  </tbody>
    
<tbody>
       <h1 class="slds-text-heading--medium">#Tasks = {!v.totalTasks}</h1>    
      <aura:iteration  items="{!v.theTaskList}" var="varTask"> 
        <c:ArchivedTaskItem theTask="{!varTask}"/>
    </aura:iteration> 
     

  </tbody>
    
</table>
   
   
    </lightning:layout>
</aura:component>

ArchijsvedActivitiesOnAccountController.js

({
    doInit : function(component, event, helper) {
         
       helper.loadEvents(component);
        helper.loadTasks(component);
        
    },
})

ArchivedActivitiesOnAccountHelper.js

({
    loadEvents : function(cmp) {
       cmp.message = 'Hello';
       var recId = cmp.get("v.recordId");
       //console.log('loadEvents recId = '+recId);
        
        
       if (recId) {
           var theAction = cmp.get("c.getArchivedEventsOnAccount");
           theAction.setParams({
                "theAccountId": recId
            });
            //console.log('action set callback recId = '+recId);
           
           theAction.setCallback(this, function(response) {
               
               var state = response.getState();
               if (state === "SUCCESS") {
                   cmp.set("v.theEventList", response.getReturnValue());
                   //this.updateTotal(cmp);
                   cmp.set("v.totalEvents", response.getReturnValue().length);
                   console.log('success '+response.getReturnValue().length);
               }
               else {
                   console.log("Failed with state: " + state);                  
               }//endif

               
            });//theAction.setCallback
            $A.enqueueAction(theAction);
           
        }//if (recID)
            
        
    },//loadEvents
    
    loadTasks : function(cmp) {
       cmp.message = 'Hello';
       var recId = cmp.get("v.recordId");
        
       if (recId) {
           var theAction = cmp.get("c.getArchivedTasksOnAccount");
           theAction.setParams({
                "theAccountId": recId
            });
            console.log('action set callback recId = '+recId);
           
           theAction.setCallback(this, function(response) {
               
               var state = response.getState();
               if (state === "SUCCESS") {
                   cmp.set("v.theTaskList", response.getReturnValue());
                   //this.updateTotal(cmp);
                   cmp.set("v.totalTasks", response.getReturnValue().length);
                   //console.log('success '+response.getReturnValue().length);
               }
               else {
                   console.log("Failed with state: " + state);                  
               }//endif

               
            });//theAction.setCallback
            $A.enqueueAction(theAction);
           
        }//if (recID)
            
        
    },//loadTasks
     
       
})

Update to ArchivedEventListController.apxc


public class ArchivedEventsListController {
    
    @AuraEnabled
    public static List<Event> getArchivedEvents(Id theContactId) {
        List<Event> eventList = new List<Event>();
        system.debug('theContactId = '+theContactId);
        Date thePast = system.today();
        thePast = thePast.addYears(-1);
        eventList = [SELECT isarchived,Id,whoId,who.name,type,activitydate,startdatetime,subject from Event  where (activitydate <= :thePast  and isdeleted = false and whoId = :theContactId) order by activitydate ALL ROWS];
        //eventList = [SELECT Subject, (select id from eventrelations) FROM Event WHERE Id = :eventRecordId];
        //[SELECT isarchived,Id,whoId,who.name,type,activitydate,subject from Event  where (activitydate < 2017-07-11  and isdeleted = false and recordtypeid = '012240000006rhtAAA') order by activitydate ALL ROWS];
        system.debug('theEvents size = '+eventList.size());
        system.debug('theEvents = '+eventList);
        return eventList;
    }//getArchivedEvents
    
     @AuraEnabled
    public static List<Task> getArchivedTasks(Id theContactId) {
        List<Task> taskList = new List<Task>();
        Date thePast = system.today();
        thePast = thePast.addYears(-1);
        //system.debug('theContactId = '+theContactId);
        taskList = [SELECT isarchived,Id,whoId,who.name,activitydate,subject from Task  where (activitydate <= :thePast  and isdeleted = false and whoId = :theContactId) order by activitydate ALL ROWS];
        //system.debug('theTasks size = '+taskList.size());
        //system.debug('theTasks = '+taskList);
        return taskList;
    }//getArchivedTasks
    
    
    @AuraEnabled
    public static List<Event> getArchivedEventsOnAccount(Id theAccountId) {
        List<Event> eventList = new List<Event>();
        //system.debug('theAccountId = '+theAccountId);
        Date thePast = system.today();
        thePast = thePast.addYears(-1);
        eventList = [SELECT isarchived,Id,whoId,who.name,type,activitydate,startdatetime,subject from Event  where (activitydate <= :thePast  and isdeleted = false and AccountId = :theAccountId) order by activitydate ALL ROWS];
        //system.debug('theEvents size = '+eventList.size());
        //system.debug('theEvents = '+eventList);
        return eventList;
    }//getArchivedEventsOnAccount
    
    @AuraEnabled
    public static List<Task> getArchivedTasksOnAccount(Id theAccountId) {
        List<Task> taskList = new List<Task>();
        Date thePast = system.today();
        thePast = thePast.addYears(-1);
        //system.debug('theContactId = '+theContactId);
        taskList = [SELECT isarchived,Id,whoId,who.name,activitydate,subject from Task  where (activitydate <= :thePast  and isdeleted = false and AccountId = :theAccountId) order by activitydate ALL ROWS];
        //system.debug('theTasks size = '+taskList.size());
        //system.debug('theTasks = '+taskList);
        return taskList;
    }//getArchivedTasksOnAccount


}
Update to TestArchivedEvents.apxc

@isTest(SeeAllData=false)
private class TestArchivedEvents {
    
    public static List<Event> eventsList;
    public static List<Task> tasksList;
    
    static testMethod void test() {
        
        Contact theContact;
        theContact = new Contact(firstname = 'Bill', lastname =  'Murray');
        insert theContact;
        
        Account theAccount;
        theAccount = new Account(name = 'Acme Inc');
        insert theAccount;
    
        init(theContact);
        
        Test.startTest();
        
     
        eventsList = ArchivedEventsListController.getArchivedEvents(theContact.Id);
        system.debug(eventsList);
        tasksList = ArchivedEventsListController.getArchivedTasks(theContact.Id);
        system.debug(tasksList);
        
        eventsList = ArchivedEventsListController.getArchivedEventsOnAccount(theAccount.Id);
        system.debug(eventsList);
        tasksList = ArchivedEventsListController.getArchivedTasksOnAccount(theAccount.Id);
        system.debug(tasksList);
      
        Test.stopTest();
        
    }//test
    
    
    static void init(Contact theContact){
       
        Event testEvent1 = new Event();
        testEvent1.Subject = 'Some training';
        testEvent1.StartDateTime=system.today()-365-365;
        testEvent1.EndDateTime=system.today()-365 -365+5;
        testEvent1.Trigger_Reminder__c = false;
        insert testEvent1;
        
        Task testTask1 = new Task();
        testTask1.Subject = 'Call';
        testTask1.ActivityDate=system.today()-365-365;
        insert testTask1;
        

    }//init

}//TestArchivedEvents


Add these components to your contact and account page.
Rich BechtoldRich Bechtold
I am having similar issues. Would this solution simply allow access to the activity information and allow you to reformat it or would it also allow you to have access to the related attachments. Our users want to be able to access the attachments as well.