View source | Discuss this page | Page history | Printable version   

Selector Example



The Business Partner selector is one of the most used selectors in the application. It allows the user pick a Customer, Vendor, etc in the the application. It composed by a drop-down list (picklist) where you can type to search, and a popup grid when you click the magnifier icon.




The main objective is to explain all the configuration settings made in the Business Partner selector. The current version of the selector is implemented as SmartClient FormItem and is using a Custom Query selector definition.

Application Dictionary definition


User Interface Definition


Defined Selector

SELECT distinct as name, as bpid, bp.searchKey as value,
   bp.creditLimit - bp.creditUsed as creditAvailable, bp.creditUsed as creditUsed,
   COALESCE(, as contactname, COALESCE(, as contactid, as locationname, as locationid,
   bp.customer as customer, bp.vendor as vendor, bp.lifetimeRevenueToDate as income
FROM BusinessPartner bp left join bp.businessPartnerLocationList bploc
                        left join bploc.locationAddress loc
                        left join bploc.aDUserList contact
                        left join loc.region region
                        left join bp.aDUserList usercontact with is null
where @additional_filters@
  and bp.summaryLevel = false

The Business Partner selector also shows the contacts and locations. The hql is joining with the associated entities. Notice in the where clause you have a constant @additional_filters@.

The @additional_filters@ appends automatically the implicit filter by Client and accessible Organizations. Notice that the client and organization filter is applied to the base table in the hql query. For eg., in the above query, the filters will be applied on the BusinessPartner bp table. Also, when filtering by an specific field in the popup grid, the Left Where Clause is appended in this location. See Defined Selector Field


Defined Selector Field

Bulbgraph.png   This is just one of the several fields defined for this selector

This part is the left side of the expression when filtering using this field. This expression is transformed in COALESCE(, like 'value' where value is the text entered by the user in the popup grid. The like operator is based on the text matching style.


Retrieved from ""

This page has been accessed 16,010 times. This page was last modified on 4 August 2014, at 07:06. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.