IDEMPIERE-460 Support for overriding reference key on web service field and allowing scripting support for ctx variable. Peer review.

This commit is contained in:
Heng Sin Low 2013-04-01 16:43:10 +08:00
parent 5a1bcc37f6
commit 2269468fb0
1 changed files with 3 additions and 3 deletions

View File

@ -1021,10 +1021,10 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
if (lookupValue != null && !"".equals(lookupValue)) { if (lookupValue != null && !"".equals(lookupValue)) {
Lookup lookup = null; Lookup lookup = null;
if(fieldInput.getAD_Reference_Value_ID()>0) if(fieldInput.getAD_Reference_ID() > 0 && fieldInput.getAD_Reference_Value_ID()>0)
{ {
try{ try{
lookup = MLookupFactory.get(m_cs.getCtx(),0,poinfo.getAD_Column_ID(poinfo.getColumnName(idxcol)),fieldInput.getAD_Reference_ID(),null,poinfo.getColumnName(idxcol),fieldInput.getAD_Reference_Value_ID(),false,null); lookup = MLookupFactory.get(m_cs.getCtx(),0,poinfo.getAD_Column_ID(poinfo.getColumnName(idxcol)),fieldInput.getAD_Reference_ID(),Env.getLanguage(m_cs.getCtx()),poinfo.getColumnName(idxcol),fieldInput.getAD_Reference_Value_ID(),false,null);
}catch (Exception e) { }catch (Exception e) {
throw new IdempiereServiceFault("Exception in resolving overridden lookup ", new QName( throw new IdempiereServiceFault("Exception in resolving overridden lookup ", new QName(
"LookupResolutionFailed")); "LookupResolutionFailed"));
@ -1121,7 +1121,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
Class<?> columnClass = getVariableType(varName, fieldInput.getAD_Reference_ID()); Class<?> columnClass = getVariableType(varName, fieldInput.getAD_Reference_ID());
Object objVal = null; Object objVal = null;
String val = field.getVal(); String val = field.getVal();
if(val!=null && val.charAt(0) == '@') if(val!=null && val.length() > 0 && val.charAt(0) == '@')
objVal = parseVariable(field.getVal(), po, poinfo, requestCtx); objVal = parseVariable(field.getVal(), po, poinfo, requestCtx);
else else
objVal = convertToObj(field.getVal(),columnClass,varName); objVal = convertToObj(field.getVal(),columnClass,varName);