0 Replies Latest reply on Mar 9, 2014 6:30 PM by d3459cb55fb33a4adb1ea6b92712cce6ac4cc367

    Get all lead activities and keep up to date

           I want to get all lead activities for all leads, and keep this up to date.
            
           I don't see an easy way to do this, because the getLeadActivity call seems to only return lead activities for a particular lead, and getLeadChanges seems to return lead activities only for a static set of leads.
            
           Instead, I am thinking the best approach is using the following pseudo code:
            
      One time catch up:
            
           all_leads = getMultipleLeads(no criteria)
            
           for activity in getLeadChanges(leadSelector->keyValues=all_leads)
                log(activity)
            
           last_run_time = now()
            
      Then periodically:
           updated_leads = getMultipleLeads(lastUpdatedSelector->oldestUpdatedAt=last_run_time)
           for activity in getLeadActivity(leadSelector->keyValues=updated_leads, lastUpdatedSelector->oldestUpdatedAt=last_run_time):
                log(activity)
           last_run_time = now()
            
           Would this work?
            
           Is this the best way to accomplish this given the current API?