Skip to main content

Advanced Search Enhancements

Goal: Usability

Developer: Igor Pojzl

Feature Ticket: IDEMPIERE-4364

Description:

Allow user to search using field from tabs other than the main tab (For e.g, Order Line tab at order window):

  • Added Tab column at Advanced Search.
  • Allow search by Product attribute at Product window

Example

  1. Advanced search with Product field at Order Line tab.
    • Advanced Search 4364

Advanced Search Example

  1. Advanced search with Product attribute at Product window.
    • Product Attribute 4364

Product attribute advanced search

Example

You need to consider the parenthesis when querying detail records as they impact the result query.

If you don't add parenthesis and you have two conditions on the same table, the result SQL will look like this:

WHERE ((( M_Product.IsActive='Y' AND EXISTS(SELECT 1 FROM M_Product_PO WHERE M_Product_PO.M_Product_ID = M_Product.M_Product_ID AND C_BPartner_ID=1006812) AND EXISTS(SELECT 1 FROM M_Product_PO WHERE M_Product_PO.M_Product_ID = M_Product.M_Product_ID AND IsCurrentVendor='Y') )))

If you set the parenthesis it will look like this

Find Parenthesis

(M_Product.IsActive = 'Y' and exists ( select 1 from M_Product_PO where M_Product_PO.M_Product_ID = M_Product.M_Product_ID and (C_BPartner_ID = 1006812 and IsCurrentVendor = 'Y')))


Source: Wiki