diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java index 8ad9f86c4d..4fb654585f 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ADLookup.java @@ -19,6 +19,7 @@ import java.util.logging.Level; import org.compiere.model.Lookup; import org.compiere.model.MLookup; import org.compiere.model.MRole; +import org.compiere.model.MTable; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -216,6 +217,8 @@ public class ADLookup { if (displayColumnName != null) { + if (displayColumnName.equals(m_keyColumnName)) + displayColumnName = MTable.get(Env.getCtx(), m_tableName).getIdentifierColumns()[0]; sql = new StringBuffer(); sql.append("SELECT ").append(m_keyColumnName) .append(" FROM ").append(m_tableName)