IDEMPIERE-4641 AD_ProcessPara.DisplayLogic is not accepting @Value_ID.ForeignColumn@ notation (#520)
This commit is contained in:
parent
402300a53e
commit
a1f39f9506
|
@ -1243,23 +1243,34 @@ public class GridField
|
|||
}
|
||||
value = Env.getContext (ctx, m_vo.WindowNo, m_vo.TabNo, variableName, tabOnly, true);
|
||||
}
|
||||
if (!Util.isEmpty(value) && !Util.isEmpty(foreignColumn) && variableName.endsWith("_ID")
|
||||
&& getGridTab() != null) {
|
||||
String refValue = "";
|
||||
if (!Util.isEmpty(value) && !Util.isEmpty(foreignColumn) && variableName.endsWith("_ID")) {
|
||||
int id = 0;
|
||||
try {
|
||||
id = Integer.parseInt(value);
|
||||
} catch (Exception e){}
|
||||
if (id > 0) {
|
||||
MColumn column = MColumn.get(ctx, getGridTab().getTableName(), variableName);
|
||||
if (column != null) {
|
||||
String foreignTable = column.getReferenceTableName();
|
||||
refValue = DB.getSQLValueString(null,
|
||||
"SELECT " + foreignColumn + " FROM " + foreignTable + " WHERE "
|
||||
+ foreignTable + "_ID = ?", id);
|
||||
String refValue = "";
|
||||
if (getGridTab() != null) {
|
||||
MColumn column = MColumn.get(ctx, getGridTab().getTableName(), variableName);
|
||||
if (column != null) {
|
||||
String foreignTable = column.getReferenceTableName();
|
||||
refValue = DB.getSQLValueString(null,
|
||||
"SELECT " + foreignColumn + " FROM " + foreignTable + " WHERE "
|
||||
+ foreignTable + "_ID = ?", id);
|
||||
}
|
||||
return refValue;
|
||||
} else {
|
||||
// no GridTab - maybe coming from process parameter, try tableName from columnName
|
||||
String foreignTable = variableName.substring(0, variableName.length()-3);
|
||||
MTable table = MTable.get(ctx, foreignTable);
|
||||
if (table != null) {
|
||||
refValue = DB.getSQLValueString(null,
|
||||
"SELECT " + foreignColumn + " FROM " + foreignTable + " WHERE "
|
||||
+ foreignTable + "_ID = ?", id);
|
||||
return refValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return refValue;
|
||||
}
|
||||
return value;
|
||||
} // get_ValueAsString
|
||||
|
|
Loading…
Reference in New Issue