ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome","ContactFacade");
try
{
//call to EJB server
ContactFacade contactFacade = contactFacadeHome.create();
contactFacade.setDataSource(this.dataSource);
for (int i=0; i<recordID.length; i++)
{
if(recordID[i] != null && !recordID[i].equals("")){
int elementID = Integer.parseInt(recordID[i]);
StringBuffer sb = new StringBuffer("00000000000");
sb.setLength(11);
String countString = Integer.toString(elementID);
sb.replace((sb.length() - countString.length()), (sb.length()), countString);
String newElementID = sb.toString();
MarketingListMemberListElement elementAt = (MarketingListMemberListElement) this.get(newElementID);
String individualStringID = (String) ((StringMember) elementAt.get("IndividualID")).getMemberValue();
String entityStringID = (String) ((StringMember) elementAt.get("EntityID")).getMemberValue();
try{
if (individualStringID == null || individualStringID.equals("") || individualStringID.equals("0"))
{
//delete the entity
//Argument individualID is added - pravink
contactFacade.deleteEntity(Integer.parseInt(entityStringID),individualID);
} //end of if statement (individualStringID == null ...
else
{
//delete the individual
//Argument individualID is added - pravink
contactFacade.deleteIndividual(Integer.parseInt(individualStringID),individualID);
} //end of else statement (individualStringID == null ...
}//end of try block
catch(AuthorizationFailedException ae){
String errorMessage = ae.getExceptionDescription();
resultDeleteLog.add(errorMessage);