You need to sign in to do that
Don't have an account?
Task Record does not showing All Task List through SOQL
Hi All,
I Have fetech Opportunity Record with Task in Sub query. My Query is Like This
Select Id, Name,
(Select Id, ActivityDate From Tasks)
From Opportunity Where IsClosed=False And BCD_Firm__c = true And Regional_Manager__c = 'XYZ' Order By Regional_Manager__c
This Query is Returning Opportunity List and it is showing only only Last 1 -2 Years Task not all Task List.
I have also fetched Separately Task by Using this Query but this This returns No Tasks for the Selected Opportunity
Select Id, ActivityDate From Task Where WhatId = 'ABC'
Here 'ABC' is Opportunity ID
Even Though Tasks Related List in organization show activities. I could not find proper explanation for this behaviour but i think SOQL query is auto filtering activities which are very old like tasks which are 4-5 years old.
Can anybody Help me to figure out This Problem ?
Thanks Jim Rae For Help
Yes you are right When i fetched Task then it is showing according to your describe condition.
Thanks All For Help
All Answers
According to the help:
Salesforce.com archives older activities according to the conditions below:
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.
This is probably what is causing your issue.
To get the archived Tasks you need to include "ALL ROWS" in your query. When you do this you need to be sure to also explicity exclude the deleted records (IsDeleted = false).
for example:
SELECT Id, ActivityDate FROM Task WHERE IsDeleted = false LIMIT 1000 ALL ROWS
Thanks Jim Rae For Help
Yes you are right When i fetched Task then it is showing according to your describe condition.
Thanks All For Help
Hi,
I tried this query in Dataloader to export all tasks that I have imported for an update
Select Id, ActivityDate FROM Task WHERE CreatedById = 'IDIDIDID' AND LastModifiedById = 'IDIDIDID' AND IsDeleted = false ALL ROWS
and I get the following message:
All ROws not allowed in this context.
What could I do to get an export of all my tasks?
"All ROWS" functionality is added after spring release."ALL ROWS" works with API Version 18.0 and in eclipse it will not run due
use like this in apex class it will work
this will return task list and export this task list
Thank you for your answer, but I'm a begginer, I don't know apex and how to use them.
Is there a simple way to export or delete all my activities to made a mass update or a mass insert with the corrections?
Thanks,
Yes There is a simple way to export you Activities
1. There is no Tab Related to Activities is Present in Salesforce.
First Create Custom Visualforce Page Tab for Activities
Then Paste this in Visualforce Page which you created for Activities Tab
This Page will show all Activiies .
2. Create StandardSetController Cladss and vf page here you can put your code for export data and also for mass update
put this code in extActivitiesExport Class
if tyou want to do sonthing with export like update anyu field calue etc then put your code in export()
This will export selcted Activities(Task) data in excel