int status = STATUS_CONTINUE;
// Delete related addresses.
status = deleteOneRelated(userInfo, delegator, entityGV, "", "Address",
originatingEntityName, new GenericEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related contacts.
status = deleteOneRelated(userInfo, delegator, entityGV, "", "Contact",
originatingEntityName, new ContactEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related activities.
status = deleteOneRelated(userInfo, delegator, entityGV, "",
"Activity", originatingEntityName, new ActivityEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related opportunities.
status = deleteOneRelated(userInfo, delegator, entityGV, "", "Deal",
originatingEntityName, new OpportunityEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related forecasts.
status = deleteOneRelated(userInfo, delegator, entityGV, "",
"Forecast", originatingEntityName, new ForecastEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related parties.
status = deleteOneRelated(userInfo, delegator, entityGV, "", "Party",
originatingEntityName, new GenericEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related entity accesses.
status = deleteOneRelated(userInfo, delegator, entityGV, "",
"EntityAccess", originatingEntityName,
new EntityAccessEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related FileAttachments. (Note: This must happen before the AccountFiles are deleted.)
status = deleteOneRelated(userInfo, delegator, entityGV, "",
"FileAttachment", originatingEntityName,
new AbstractAttachmentEP());
if (status != STATUS_CONTINUE) {
return status;
}
// Delete related AccountFiles. (Note: This must happen after the FileAttachments are deleted.)
status = deleteOneRelated(userInfo, delegator, entityGV, "",
"AccountFile", originatingEntityName,
new GenericEventProcessor());
if (status != STATUS_CONTINUE) {
return status;
}