throws CommunicationException, NamingException
{
String dataSource = Settings.getInstance().getSiteInfo(
CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
String status = returnStatus;
CustomFieldVO custVo = new CustomFieldVO();
String fieldidStr = request.getParameter("fieldid");
HttpSession session = request.getSession(true);
UserObject userobject = (UserObject)session.getAttribute("userobject");
int individualID = userobject.getIndividualID();
if (fieldidStr == null) {
fieldidStr = "0";
}
int fieldId = Integer.parseInt(fieldidStr);
String fieldType = request.getParameter("fieldType");
String value = request.getParameter("text");
if (value == null) {
value = "";
}
int recordID = 0;
if (request.getParameterValues("recordID") != null) {
recordID = Integer.parseInt(request.getParameter("recordID"));
}
custVo.setValue(value);
custVo.setFieldType(fieldType);
custVo.setFieldID(fieldId);
custVo.setRecordID(recordID);
CustomFieldHome cfh = (CustomFieldHome)CVUtility.getHomeObject(
"com.centraview.customfield.CustomFieldHome", "CustomField");
try {
CustomField remote = cfh.create();
remote.setDataSource(dataSource);
remote.updateCustomField(custVo);
CustomFieldVO cfvo = remote.getCustomField(fieldId);
ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject(
"com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
ContactFacade remoteContactFacade = contactFacadeHome.create();
remoteContactFacade.setDataSource(dataSource);
cfvo.setRecordID(recordID);
remoteContactFacade.updateModifiedBy(cfvo, individualID);
} catch (Exception e) {
logger.error("[Exception] UpdateCustomFieldHandler.perform ", e);
}
return status;