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
gowdagowda 

Retrieve All the Contacts

Hi All

I am trying to pull all the Contacts from my client application which i created after i signed up for the developer edition,

I should use binding.getUpdated(param1,param2,param3), Or is there any method which i have to use to get all the Contact Lists(Old + New)

regards

gowda

DevAngelDevAngel

Hi gowda,

Have you tried "Select Id From Contact" ?

gowdagowda

Nope...Infact i have the same capability for the Leads also , but even though i have more Leads which is assigned to my account + the ones which i created , I tried using the methods binding.getUpdated(), but it didn't give me any Id's i.,e Id's are null

this is what i did to get all the Leads

 try{
           updatedLeads = binding.getUpdated("Lead", 
                (Calendar)startTime, (Calendar)endTime);
         }catch(Exception ex){
              System.out.println("couldn't get the updated leads");
         }
        
          ID [] ids = updatedLeads.getIds();
          if (ids != null && ids.length > 0) {
                for (int i=0;i<ids.length;i++) {
                  System.out.println("Lead=" + ids[i].getValue() + " was updated between " +
                           startTime.getTime().toString() + " and " + endTime.getTime().toString());
                }    
              } else {
                 System.out.println("No updates to Lead in the last 5 minutes.");
             }

Hope the same methods will be used for all the objects,

Kindly let me know about this.

regards

gowda

 

DevAngelDevAngel

Hi gowda,

I think maybe we need to back up a little here.

There are 2 ways to get updated or created items based on dates.  Unless you are polling on a regular interval on the order of anywhere between 5mins and, say, 24 hours, you should be using a query that uses the createdDate or systemmodstamp fields for the criteria.  If you are polling then you would use the getUpdated and manage your starttime and endtime parameters meticulously.

Once your polling process is interupted, you will need to adjust the starttime so that you don't have any gaps in the time slices.

The getupdated will not return any values that are over a month old.

Please explain what it is you are trying to accomplish and I will attempt to present a valid solution model to help you accomplish it.

 

gowdagowda

Hi Dave

Well I have time frame with a time gap say example , 5 minutes between the startTime and endTime, My bussiness logic is to retrieve all the Leads from the sales force , It could be an New Leads, Existing Leads or Updated Leads and puts in to our database. Actually this logic will run as an Cron Job in our application ,this is one bussiness logic which i am trying to do for Lead Objects,

Let me know if you need any more information

Regards

gowda