use of com.salesforce.soap.partner.GetDeletedResult in project tdi-studio-se by Talend.
the class PartnerSamples method getDeletedSample.
private void getDeletedSample() {
// 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);
GetDeletedResult mr = binding.getDeleted("Contact", cal, calEnd);
if (mr.getDeletedRecords() != null) {
for (int i = 0; i < mr.getDeletedRecords().length; i++) {
System.out.println(mr.getDeletedRecords(i).getId() + " was deleted on " + mr.getDeletedRecords(i).getDeletedDate().getTime().toString());
}
} else {
System.out.println("No deletions from contacts in the last 5 minutes.");
}
getUserInput("\nHit return to continue...");
} catch (ApiFault af) {
System.out.println("\nFailed to get deleted records, error message was: \n" + af.getExceptionMessage());
getUserInput("\nHit return to continue...");
} catch (Exception ex) {
System.out.println("\nFailed to get deleted records, error message was: \n" + ex.getMessage());
getUserInput("\nHit return to continue...");
}
}
use of com.salesforce.soap.partner.GetDeletedResult in project tdi-studio-se by Talend.
the class SforceManagementImpl method getDeleted.
@Override
public GetDeletedResult getDeleted(String objectType, Calendar startDate, Calendar endDate) throws Exception {
GetDeleted getDeleted = new GetDeleted();
getDeleted.setSObjectType(objectType);
getDeleted.setStartDate(startDate);
getDeleted.setEndDate(endDate);
GetDeletedResult result = sforceConn.getDeleted(getDeleted).getResult();
// }
return result;
}
Aggregations