-- List of windows, tabs and columns with an associated field that is displayed and active. select w.name as windowname, tb.name as tabname, t.tablename, c.ad_column_id, c.columnname, c.ad_reference_id, c.ad_reference_value_id, c.isupdateable, f.isreadonly from ad_window w, ad_tab tb, ad_table t, ad_column c, ad_field f where w.ad_window_id = tb.ad_window_id and tb.ad_table_id = t.ad_table_id and c.ad_table_id = t.ad_table_id and c.ad_column_id = f.ad_column_id and f.ad_tab_id = tb.ad_tab_id and tb.tablevel > 0 -- child tab and w.isactive = 'Y' and tb.isactive = 'Y' and t.isactive = 'Y' and c.isparent = 'Y' -- link to the parent tab and f.isactive = 'Y' and f.isdisplayed = 'Y' and ((c.ad_reference_id = '30' and c.ad_reference_value_id is not null) -- Using selector or c.ad_reference_id = '19' -- TableDir ) order by w.name, tb.tablevel, tb.seqno, c.ad_column_id