View source | View content page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Projects:Selector/Functional Gap

Contents

Introduction

The New Selector aims to generalize the problem of defining a selector using only the Application Dictionary. As any generalization it cannot cover all the specific cases. This document aims to collect those special cases, some functionality implemented in current selectors through manual code.

Functional Gap between old and new Selectors

Creator/Selector

There are selectors that allows the user create a new records in the same dialog (pop-up window):

In/Out columns

In/Out columns can be defined in the old implementation as Selector Reference columns.

Current implementation of the new selector only returns the name/value of the selected item, but not Out columns. Out columns are used in the Business Partner, Product and Product Complete selectors:

Query used to get the number of In/Out columns per selector

 
SELECT a.name, c.total AS total_col_out
 FROM ad_ref_search ar, ad_reference a, 
      (SELECT ad_ref_search_id, count(*) AS total 
         FROM ad_ref_search_column 
        WHERE columntype = 'O' -- change to 'I' for in columns
        GROUP BY ad_ref_search_id) c
WHERE a.ad_reference_id = ar.ad_reference_id
  AND ar.ad_ref_search_id = c.ad_ref_search_id
ORDER BY a.name;
Bulbgraph.png   This query and other useful ones can be downloaded from bitbucket.org

Out columns

Selector # Out columns
Business Partner 2
Product 10
Product Complete 10

In columns

Bulbgraph.png   When the page request to open the selector dialog, the request contains the whole form, so any _in_ parameter can be found in the request and can be used for extra filtering
Selector # In columns Comments
Account 2 AD_Org_ID, C_AcctSchema_ID - Both values are present in the form so there is no need to define a in column for this?
Account Element Value 0
Business Partner 1 AD_Org_ID
Debt/Payment 1 AD_Org_ID
Invoice 1 AD_Org_ID
Invoice Line 1 AD_Org_ID
Location 1 AD_Org_ID
Locator 2 AD_Org_ID, M_Warehouse_ID
Order 1 AD_Org_ID
Order Line 3 AD_Org_ID, C_BPartner_ID, M_Product_ID
Order Payment Plan 0
Product 4 AD_Org_ID, M_PriceList_ID, M_Warehouse_ID, DateOrdered
Product Complete 3 AD_Org_ID, M_PriceList_ID, C_BPartner_ID
Project 2 AD_Org_ID, C_BPartner_ID
Shipment/Receipt 1 AD_Org_ID
Shipment/Receipt Line 3 AD_Org_ID, C_Location_ID, AD_User_ID

There are new selectors implemented in the old-fashioned way that are not using AD_Org_ID as _in_ parameter. And it seems that are working just fine.

Multiple selection

This 2 return more than just 1 pair key/value. Are used in 'manual code'. The filter window for dimensional reports.

Data translation

_TRL tables

There are 3 selectors that translate data:


Parts of the SQLs that have a _TRL query:

ProductComplete_data.xsql

 
-- code omitted
FROM C_UOM U1 LEFT JOIN C_UOM_TRL U1TRL ON U1.C_UOM_ID = U1TRL.C_UOM_ID AND U1TRL.AD_LANGUAGE = ? WHERE U1.C_UOM_ID = C_UOM1_ID
-- code omitted
C_UOM U1    LEFT JOIN C_UOM_TRL U1TRL ON U1TRL.C_UOM_ID= U1.C_UOM_ID

Account_data.xsql

 
-- code omitted
SELECT EV.C_ElementValue_ID AS ID, (EV.VALUE || ' - ' || (CASE WHEN td_trl1.Name IS NULL THEN TO_CHAR(EV.Name) ELSE TO_CHAR(td_trl1.Name) END)) AS NAME,
'' AS DESCRIPTION 
-- code omitted
 LEFT JOIN C_ElementValue_Trl td_trl1 ON EV.C_ElementValue_ID = td_trl1.C_ElementValue_ID AND td_trl1.AD_Language = ?,
-- code omitted

DebtPayment_data.xsql

 
-- code omitted
(SELECT COALESCE(RLT.NAME, RL.NAME) FROM AD_REF_LIST RL LEFT JOIN AD_REF_LIST_TRL RLT ON RL.AD_REF_LIST_ID = RLT.AD_REF_LIST_ID AND RLT.AD_LANGUAGE = ?
-- code omitted

AD_Column_Identifier calls

Some selectors have AD_Column_Identifier function calls, that performs implicit data translation

ProductComplete_data.xsql

 
-- code omitted
WHERE UPPER(AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(M_Product_ID), TO_CHAR(?))) = UPPER(?)
-- code omitted

Product_data.xsql

 
-- code omitted
WHERE UPPER(AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(M_Product_ID), TO_CHAR(?))) = UPPER(?)
-- code omitted

Locator_data.xsql

 
-- code omitted
SELECT m.M_LOCATOR_ID, mw.NAME, m.VALUE, REPLACE(AD_COLUMN_IDENTIFIER(TO_CHAR('M_LOCATOR'),
TO_CHAR(m.M_LOCATOR_ID), TO_CHAR(?)), '''', chr(92)||'''') AS VALUE_HIDDEN, m.PRIORITYNO, 
-- code omitted

DebtPayment_data.xsql

 
-- code omitted
C_DEBT_PAYMENT_ID || '#' || Ad_Column_Identifier(TO_CHAR('C_Debt_Payment'), TO_CHAR(C_DEBT_PAYMENT_ID), TO_CHAR(?)) AS ROWKEY,
-- code omitted

Location_Search_data.xsql

 
-- code omitted
AD_COLUMN_IDENTIFIER(TO_CHAR('C_Location'), TO_CHAR(L.C_LOCATION_ID), ?) AS NAME,
-- code omitted
SELECT AD_COLUMN_IDENTIFIER(TO_CHAR('C_Location'), TO_CHAR(L.C_LOCATION_ID), ?) AS NAME 
-- code omitted

Sorting by Multiple Columns

With current selectors the user can only sort by one column. In previous implementation, the user, holding the CTRL key can click several columns and sort by them.

Retrieved from "http://wiki.openbravo.com/wiki/Projects:Selector/Functional_Gap"

This page has been accessed 4,612 times. This page was last modified on 8 June 2012, at 05:30. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.