You need to sign in to do that
Don't have an account?
chris_centra
SOQL for recurring Task?
Hello. Years ago I wrote some Apex code (batch process) which determines the "most recent Task" on a Contact. It queries the TaskRelation object for each Contact, does some filtering, and chooses the mostly recently completed Task. No problem - until recently the Users started creating recurring Tasks. My code doesn't see them. I did some digging and i found the following:
1) if i run a simple soql query on a NON-recurring Task, one record is returned (Select Id From Task WHERE Id = '00TE0000018y793')
BUT...
2) if i update that Task, setting the RepeatThisTask (RecurrenceRegeneratedType) and RecurrenceInterval fields to non-null values - and i run the exact same query, no record is returned.
What is happening here? Does the record find its way to a different object, or do i have to run the query differently? (FWIW, i notice that with a recurring Task, the TaskRelation record exists - and it points to the correct TaskId, but if i try to pull values from that related Task via SOQL, i get nothing...)
thanks very much for your time.
chris
1) if i run a simple soql query on a NON-recurring Task, one record is returned (Select Id From Task WHERE Id = '00TE0000018y793')
BUT...
2) if i update that Task, setting the RepeatThisTask (RecurrenceRegeneratedType) and RecurrenceInterval fields to non-null values - and i run the exact same query, no record is returned.
What is happening here? Does the record find its way to a different object, or do i have to run the query differently? (FWIW, i notice that with a recurring Task, the TaskRelation record exists - and it points to the correct TaskId, but if i try to pull values from that related Task via SOQL, i get nothing...)
thanks very much for your time.
chris
In your case, perhaps you have a trigger or something else in your org or your code that is automatically deleting the non-recurring task? Can you confirm in the actual Salesforce UI whether you can still see the task? And if so, whether its Task ID has changed?
All Answers
In your case, perhaps you have a trigger or something else in your org or your code that is automatically deleting the non-recurring task? Can you confirm in the actual Salesforce UI whether you can still see the task? And if so, whether its Task ID has changed?
chris
[1]: Spring '14 (https://help.salesforce.com/help/pdfs/en/salesforce_spring14_release_notes.pdf)