* Method called by the Form panel to insert new data.
* @param newValueObject value object to save
* @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
*/
public Response insertRecord(ValueObject newPersistentObject) throws Exception {
Subject sub = (Subject)newPersistentObject;
sub.setSubjectTypeREG04((String)detailFrame.getControlSubjectType().getValue());
if (sub.getSubjectTypeREG04().equals(ApplicationConsts.SUBJECT_ORGANIZATION_CONTACT)) {
OrganizationVO vo = (OrganizationVO)sub;
if (organization!=null) {
vo.setCompanyCodeSys01Reg04REG04(organization.getCompanyCodeSys01REG04());
vo.setProgressiveReg04REG04(organization.getProgressiveREG04());
}
}
else {
PeopleVO vo = (PeopleVO)sub;
if (organization!=null) {
vo.setCompanyCodeSys01Reg04REG04(organization.getCompanyCodeSys01REG04());
vo.setProgressiveReg04REG04(organization.getProgressiveREG04());
}
}
Response response = ClientUtils.getData("insertContact",newPersistentObject);
if (!response.isError()) {
sub = (Subject)((VOResponse)response).getVo();
subVO = new SubjectVO(
sub.getCompanyCodeSys01REG04(),
sub.getProgressiveREG04(),
null, // it's not very good...
null, // it's not very good...
sub.getSubjectTypeREG04()
);
SubjectPK pk = new SubjectPK(
sub.getCompanyCodeSys01REG04(),
sub.getProgressiveREG04()
);
// gridFrame.reloadData();
detailFrame.getReferencesPanel().getGrid().getOtherGridParams().put(