// Getting MethodOfContactVO List from Individual Object
Collection mocList = individualDetail.getMOC();
Iterator it = mocList.iterator();
int counter = 0;
MethodOfContactVO mocVO = null;
while (it.hasNext()) {
mocVO = (MethodOfContactVO)it.next();
// Count all the Mobile and Phone type MOCs that were manually added.
// If there were none, try to inheirit copies of them from the parent
// entity.
if (mocVO.getIsPrimary().equals("YES")) {
counter++;
}
// We are passing the Extra boolean value to the method. if the boolean
// value is false then we wil not update the individual table
remote.addMOC(mocVO, individualID, 2, userID, false); // Hardcoded for
// Individual
// ContactType
}
// if counter < 1 then there were no phone or mobile numbers entered for
// this individual. So we should try and suck down copies of the Entities.
if (counter < 1) {
Collection col = remote.getAllMOCForContact(userID, individualDetail.getEntityID(), 1);
if (col != null) {
Iterator mocIter = col.iterator();
while (mocIter.hasNext()) {
mocVO = (MethodOfContactVO)mocIter.next();
// we ussed to only copy "Main" and "Fax" types, but per Alan's
// request this has been changed. Please see bug #88. I have
// changed this to copy ALL MOC's.
if (mocVO.getIsPrimary().equals("YES")) {
remote.addMOC(mocVO, individualID, 2, userID, false); // false means don't update the modified timestamp of individual record
}
}
}
}