The organization I work for is wanting to do a little house cleaning in our Salesforce setup, and they want to start with old tasks. Our phone system syncs via the SOAP API to log all phone calls as Tasks in salesforce, so the quantities of records that have been created in the 4 years we've used the product is staggeringly high compared to everything else.

So, with that in mind, I'm trying to build a script that will delete segments of the records en masse, and I need to separate them out by the date they were created. I can run a report to segment out the data the way I want and give me, say, the number of records created before 1/1/2011, but I'm not seeing any way to achieve similar results with the API. The only date field the object reference guide has that isn't recurring is ActivityDate (aka Due Date). What am I missing, or is this not something I can access through the API?

Thanks! --Lisa

  • 1
    You can definitely access CreatedDate and LastModifiedDate; are those not working for you?
    – Mike Chale
    May 16, 2013 at 19:00
  • 2
    You should be able to use the Data Loader to extract tasks with a CreatedDate less than x and then using those Ids delete them in Salesforce. Also tasks older than 2 years (I think) are archived and need ALL ROWS predicate to retrieve them I believe. May 16, 2013 at 19:02
  • You're correct, older tasks are archived automatically, but we've had our archival date extended to whatever SF's maximum is. Also, I think my issue appears to be the use of 'CreatedDate' vs. 'CreateDate'. I didn't know the exact spelling of the field, and apparently I guessed wrong.
    – Lisa
    May 16, 2013 at 19:04

1 Answer 1


'CreatedDate', as a field, is accessible. But since I didn't find the field in the information about the Object, I wasn't sure what the proper spelling of it was and I was trying to access 'CreateDate'.

  • 2
    Whenever I'm in doubt I turn to either the Data Loader or workbench.developerforce.com to verify and test queries.
    – Mike Chale
    May 16, 2013 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .