* Callback method called by the Form panel when the Form is set to INSERT mode.
* The method can pre-set some v.o. attributes, so that some input controls will have a predefined value associated.
* @param persistentObject new value object
*/
public void createPersistentObject(ValueObject PersistentObject) throws Exception {
DetailSupplierVO vo = (DetailSupplierVO)PersistentObject;
ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
if (applet.getAuthorizations().isOneCompany()) {
ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
ArrayList companiesList = bca.getCompaniesList("PUR01");
vo.setCompanyCodeSys01REG04( companiesList.get(0).toString() );
}
// set default values...
HashMap map = new HashMap();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.DEBITS_ACCOUNT);
Response response = ClientUtils.getData("loadUserParam",map);
if (!response.isError()) {
String code = (String)((VOResponse)response).getVo();
vo.setDebitAccountCodeAcc02PUR01(code);
detailFrame.getControlDebitsCode().setValue(code);
detailFrame.getControlDebitsCode().getLookupController().forceValidate();
}
map.clear();
map.put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01REG04());
map.put(ApplicationConsts.PARAM_CODE,ApplicationConsts.COSTS_ACCOUNT);
response = ClientUtils.getData("loadUserParam",map);
if (!response.isError()) {
String code = (String)((VOResponse)response).getVo();
vo.setCostsAccountCodeAcc02PUR01(code);
detailFrame.getControlCostsCode().setValue(code);
detailFrame.getControlCostsCode().getLookupController().forceValidate();
}
}