Implement [1762461] - Remove hardcoded list items checking in generated models
https://sourceforge.net/tracker2/index.php?func=detail&aid=1762461&group_id=176962&atid=879335 Show valid values in error message
This commit is contained in:
parent
381da83ae1
commit
5bc3fbc260
|
@ -785,9 +785,13 @@ public abstract class PO
|
||||||
if (MRefList.get(getCtx(), p_info.getColumn(index).AD_Reference_Value_ID,
|
if (MRefList.get(getCtx(), p_info.getColumn(index).AD_Reference_Value_ID,
|
||||||
(String) value, get_TrxName()) != null)
|
(String) value, get_TrxName()) != null)
|
||||||
;
|
;
|
||||||
else
|
else {
|
||||||
|
StringBuffer validValues = new StringBuffer();
|
||||||
|
for (ValueNamePair vp : MRefList.getList(getCtx(), p_info.getColumn(index).AD_Reference_Value_ID, false))
|
||||||
|
validValues.append(" - ").append(vp.getValue());
|
||||||
throw new IllegalArgumentException(ColumnName + " Invalid value - "
|
throw new IllegalArgumentException(ColumnName + " Invalid value - "
|
||||||
+ value + " - Reference_ID=" + p_info.getColumn(index).AD_Reference_Value_ID);
|
+ value + " - Reference_ID=" + p_info.getColumn(index).AD_Reference_Value_ID + validValues.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (CLogMgt.isLevelFinest())
|
if (CLogMgt.isLevelFinest())
|
||||||
log.finest(ColumnName + " = " + m_newValues[index] + " (OldValue="+m_oldValues[index]+")");
|
log.finest(ColumnName + " = " + m_newValues[index] + " (OldValue="+m_oldValues[index]+")");
|
||||||
|
|
Loading…
Reference in New Issue