You need to sign in to do that
Don't have an account?
gowda
How to get the New Leads
I go online log into my developer edition and create a New Lead ,
Now in my client application i need to pull all the New Leads,
Which method i should use to find out all the New Objects like Accounts, Leads etc...
I appreciate any help on this.
regards
gowda
Well i did that below is the code
private GetUpdatedResult updatedLeads = null;
try{
updatedLeads = binding.getUpdated(descSObjectRslt.getName(),
(Calendar)startTime, (Calendar)endTime);
System.out.println("Length of the Leads =" + updatedLeads.getIds().length);
}catch(Exception ex){
System.out.println("couldn't get the updated leads");
}
Even though i created 3 Leads today i get Null Pointer Exception..
Let me know if i am doing right here..
Regards
GGowda
I assume you have already logged in and the binding is set up correctly?
well its in side the try block, i.,e while calling getUpdated
updatedLeads = binding.getUpdated(descSObjectRslt.getName(),
(Calendar)startTime, (Calendar)endTime);
By the way i have a login logic once it gets authenticated, I have a code to get all the objects which is assigned to my account, I was able to get the meta information about the Lead Object, And then i have the above code to get all the leads which is where its failing..i.,e getting Null Pointer Exception.
Let me know if i need to do anything before calling this object..
It seems like binding, descsObjectRslt, startTime, or endTime must be null
I checked all of the above , but i don't get any null there, By the way here is the code...
try{
updatedLeads = binding.getUpdated("Lead",
(Calendar)startTime, (Calendar)endTime);
System.out.println("Length of the Leads =" + updatedLeads.getIds().length);
}catch(Exception ex){
System.out.println("couldn't get the updated leads");
}
if (updatedLeads.getIds().length > 0) { // <----- I am getting Null Pointer at this line
for (int i=0;i<updatedLeads.getIds().length;i++) {
System.out.println("Leads =" + updatedLeads.getIds(i).getValue() + " was updated between " +
startTime.getTime().toString() + " and " + endTime.getTime().toString());
}
} else {
System.out.println("No updates to accounts in the last 5 minutes.");
}
Kindly let me know about this, I wasted nearly 4 hours on debugging this.
regards
gowda
Try
ID[] ids = updatedLeads.getIds;()
if (ids != null && ids.length > 0) {
Thanks for your information...
I tried as u said..this is the below code
ID [] ids = updatedLeads.getIds();
if (ids != null && ids.length > 0) {
for (int i=0;i<ids.length;i++) {
System.out.println("Leads =" + ids[i].getValue() + " was updated between " +
startTime.getTime().toString() + " and " + endTime.getTime().toString());
}
} else {
System.out.println("No updates to accounts in the last 5 minutes.");
}
Now i didn't get any Null Pointer Exception...But it displayed the ELSE part, By the way its getting only the updated Leads taking the time frame in to account ?
Let me know about this