private boolean hasSearchableColumns(){
  boolean retValue=false;
  m_tableName=MQuery.getZoomTableName(m_columnName);
  m_keyColumnName=MQuery.getZoomColumnName(m_columnName);
  if (m_columnName.equals("M_Product_ID") || m_columnName.equals("M_ProductBOM_ID") || m_columnName.equals("C_BPartner_ID")|| m_columnName.equals("C_Order_ID")|| m_columnName.equals("C_Invoice_ID")|| m_columnName.equals("M_InOut_ID")|| m_columnName.equals("C_Payment_ID")|| m_columnName.equals("GL_JournalBatch_ID")|| m_columnName.equals("SalesRep_ID")) {
    retValue=true;
  }
 else {
    String query="SELECT t.TableName, c.ColumnName " + "FROM AD_Column c " + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID AND t.IsView='N')"+ " WHERE (c.ColumnName IN ('DocumentNo', 'Value', 'Name') OR c.IsIdentifier='Y')"+ " AND c.AD_Reference_ID IN (10,14)"+ " AND EXISTS (SELECT * FROM AD_Column cc WHERE cc.AD_Table_ID=t.AD_Table_ID"+ " AND cc.IsKey='Y' AND cc.ColumnName=?)";
    PreparedStatement pstmt=null;
    ResultSet rs=null;
    try {
      pstmt=DB.prepareStatement(query,null);
      pstmt.setString(1,m_keyColumnName);
      rs=pstmt.executeQuery();
      if (rs.next()) {
        retValue=true;
      }
    }
 catch (    SQLException ex) {
      log.log(Level.SEVERE,query,ex);
    }
 finally {
      DB.close(rs,pstmt);
      rs=null;
      pstmt=null;
    }
  }
  return retValue;
}

private boolean hasSearchableColumns ( ) { boolean retValue = false ; m_tableName = MQuery . getZoomTableName ( m_columnName ) ; m_keyColumnName = MQuery . getZoomColumnName ( m_columnName ) ; if ( m_columnName . equals ( "M_Product_ID" ) || m_columnName . equals ( "M_ProductBOM_ID" ) || m_columnName . equals ( "C_BPartner_ID" ) || m_columnName . equals ( "C_Order_ID" ) || m_columnName . equals ( "C_Invoice_ID" ) || m_columnName . equals ( "M_InOut_ID" ) || m_columnName . equals ( "C_Payment_ID" ) || m_columnName . equals ( "GL_JournalBatch_ID" ) || m_columnName . equals ( "SalesRep_ID" ) ) { retValue = true ; } else { String query = "SELECT t.TableName, c.ColumnName " + "FROM AD_Column c " + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID AND t.IsView='N')" + " WHERE (c.ColumnName IN ('DocumentNo', 'Value', 'Name') OR c.IsIdentifier='Y')" + " AND c.AD_Reference_ID IN (10,14)" + " AND EXISTS (SELECT * FROM AD_Column cc WHERE cc.AD_Table_ID=t.AD_Table_ID" + " AND cc.IsKey='Y' AND cc.ColumnName=?)" ; PreparedStatement pstmt = null ; ResultSet rs = null ; try { pstmt = DB . prepareStatement ( query , null ) ; pstmt . setString ( 1 , m_keyColumnName ) ; rs = pstmt . executeQuery ( ) ; if ( rs . next ( ) ) { retValue = true ; } } catch ( SQLException ex ) { log . log ( Level . SEVERE , query , ex ) ; } finally { DB . close ( rs , pstmt ) ; rs = null ; pstmt = null ; } } return retValue ; }
determines if the lookup has searchable ( text ) fields .
