From a8882677a09ccc3c4445505cec8e814d158ae42e Mon Sep 17 00:00:00 2001 From: Diego Ruiz <12065321+d-ruiz@users.noreply.github.com> Date: Fri, 5 May 2023 18:13:19 +0200 Subject: [PATCH] IDEMPIERE-5709 - Fixed SQLFind columns not working (#1822) --- .../src/org/adempiere/webui/window/FindWindow.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 37729ba4dd..506a030486 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -2253,7 +2253,7 @@ public class FindWindow extends Window implements EventListener, ValueCha if (field == null || field.isVirtualUIColumn()) continue; isProductCategoryField = isProductCategoryField(field.getColumnName()); - ColumnSQL = field.getColumnSQL(false); + ColumnSQL = field.getSearchColumnSQL() != null ? field.getSearchColumnSQL() : field.getColumnSQL(false); if (table.getSelectedItem() != null && !table.getSelectedItem().getValue().equals(m_AD_Tab_UU)) { if (!isCompositeExists) { @@ -2640,7 +2640,7 @@ public class FindWindow extends Window implements EventListener, ValueCha GridField field = getTargetMField(ColumnName); boolean isProductCategoryField = isProductCategoryField(field.getColumnName()); - StringBuilder ColumnSQL = new StringBuilder(field.getSearchColumnSQL()); + StringBuilder ColumnSQL = field.getSearchColumnSQL() != null ? new StringBuilder(field.getSearchColumnSQL()) : new StringBuilder(field.getColumnSQL(false)); // add encryption here if the field is encrypted. if (field.isEncrypted()) { @@ -2660,9 +2660,7 @@ public class FindWindow extends Window implements EventListener, ValueCha m_query.addRestriction(clause); continue; } - - isProductCategoryField = isProductCategoryField(field.getColumnName()); - ColumnSQL = new StringBuilder(field.getColumnSQL(false)); + // // Be more permissive for String columns if (isSearchLike(field))