use of com.salesforce.soap.partner.GetUpdatedResult in project tdi-studio-se by Talend.
the class PartnerSamples method getUpdatedSample.
private void getUpdatedSample() {
// call the login function to do so
if (!loggedIn) {
if (!login()) {
return;
}
}
try {
// Calendar deletedDate
GregorianCalendar cal = (GregorianCalendar) binding.getServerTimestamp().getTimestamp();
GregorianCalendar calEnd = (GregorianCalendar) cal.clone();
cal.add(GregorianCalendar.MINUTE, -5);
GetUpdatedResult mr = binding.getUpdated("Account", cal, calEnd);
if (mr.getIds() != null && mr.getIds().length > 0) {
for (int i = 0; i < mr.getIds().length; i++) {
System.out.println(mr.getIds(i) + " was updated.");
}
} else {
System.out.println("No updates to accounts in the last 5 minutes.");
}
getUserInput("\nHit return to continue...");
} catch (ApiFault af) {
System.out.println("\nFailed to get updated records, error message was: \n" + af.getExceptionMessage());
getUserInput("\nHit return to continue...");
} catch (Exception ex) {
System.out.println("\nFailed to get updated records, error message was: \n" + ex.getMessage());
getUserInput("\nHit return to continue...");
}
}
use of com.salesforce.soap.partner.GetUpdatedResult in project tdi-studio-se by Talend.
the class SforceManagementImpl method getUpdated.
@Override
public ID[] getUpdated(String objectType, Calendar startDate, Calendar endDate) throws Exception {
GetUpdated getUpdated = new GetUpdated();
getUpdated.setSObjectType(objectType);
getUpdated.setStartDate(startDate);
getUpdated.setEndDate(endDate);
GetUpdatedResult result = sforceConn.getUpdated(getUpdated).getResult();
ID[] ids = result.getIds();
return ids;
}
Aggregations