opportunityDetailForm = (OpportunityDetailForm) getForm(OPPORTUNITY_DETAIL_FORM);
if (validateBeanProperties(opportunityDetailForm)) {
try {
opportunityVO = new OpportunityVO();
CustomerMapperFactory.getOpportunityMapper().mapToObj(opportunityDetailForm, opportunityVO);
UserVO loggedInUserVO = (UserVO)getSession().getAttribute(Constants.LOGGED_IN_USER);
if (opportunityVO.getOpportunityId() == null) {
opportunityVO.setCreatedOn(new Date());
opportunityVO.setCreatedBy(loggedInUserVO.getUserIdent());
}
else {
opportunityVO.setModifiedOn(new Date());
opportunityVO.setModifiedBy(loggedInUserVO.getUserIdent());
}
opportunityVO = dataServiceLocator.getOpportunityService().saveOpportunity(opportunityVO);
CustomerMapperFactory.getOpportunityMapper().mapToBean(opportunityVO, opportunityDetailForm);
} catch (OpportunityServiceException ex) {
logger.error("DAO exception occured, cause: ", ex);