src-wad/src/org/openbravo/wad/Fields_data.xsql
changeset 1605 8a0fe0193bef
parent 1239 e5124b398f64
child 1879 b3ed43f23524
equal deleted inserted replaced
1604:a1c518e6ed93 1605:8a0fe0193bef
    40            ad_field,  ad_table
    40            ad_field,  ad_table
    41       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
    41       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
    42         AND ad_column.ad_table_id = ad_table.ad_table_id 
    42         AND ad_column.ad_table_id = ad_table.ad_table_id 
    43         AND ad_column.isActive = 'Y' 
    43         AND ad_column.isActive = 'Y' 
    44         AND upper(ad_column.columnname) <> 'BINARYDATA' 
    44         AND upper(ad_column.columnname) <> 'BINARYDATA' 
    45         AND ad_tab_id = to_number(?)
    45         AND ad_tab_id = ?
    46       ORDER BY ad_field.SEQNO
    46       ORDER BY ad_field.SEQNO
    47       ]]>
    47       ]]>
    48     </Sql>
    48     </Sql>
    49     <Parameter name="tab"/>
    49     <Parameter name="tab"/>
    50   </SqlMethod>
    50   </SqlMethod>
    58       SELECT f.Name As Name, f.isDisplayed as isdisplayed, f.isEncrypted, c.AD_REFERENCE_ID as reference, 
    58       SELECT f.Name As Name, f.isDisplayed as isdisplayed, f.isEncrypted, c.AD_REFERENCE_ID as reference, 
    59       c.FIELDLENGTH, 'Medio' as Text_Align, f.displaylength, c.ColumnName, f.showInRelation 
    59       c.FIELDLENGTH, 'Medio' as Text_Align, f.displaylength, c.ColumnName, f.showInRelation 
    60       FROM ad_field f, ad_column c 
    60       FROM ad_field f, ad_column c 
    61       WHERE f.ad_column_id = c.ad_column_id 
    61       WHERE f.ad_column_id = c.ad_column_id 
    62       AND f.showInRelation = 'Y' 
    62       AND f.showInRelation = 'Y' 
    63       AND f.ad_tab_id = to_number(?) 
    63       AND f.ad_tab_id = ? 
    64       ORDER BY f.SEQNO
    64       ORDER BY f.SEQNO
    65     </Sql>
    65     </Sql>
    66     <Parameter name="tab"/>
    66     <Parameter name="tab"/>
    67   </SqlMethod>
    67   </SqlMethod>
    68   <SqlMethod name="selectDescriptionTrl" type="preparedStatement" return="multiple">
    68   <SqlMethod name="selectDescriptionTrl" type="preparedStatement" return="multiple">
    74                                               AND ft.isactive = 'Y'
    74                                               AND ft.isactive = 'Y'
    75                                               AND ft.ad_language = ?, 
    75                                               AND ft.ad_language = ?, 
    76            ad_column c 
    76            ad_column c 
    77       WHERE f.ad_column_id = c.ad_column_id 
    77       WHERE f.ad_column_id = c.ad_column_id 
    78       AND f.showInRelation = 'Y' 
    78       AND f.showInRelation = 'Y' 
    79       AND f.ad_tab_id = to_number(?)    
    79       AND f.ad_tab_id = ?    
    80       ORDER BY f.SEQNO
    80       ORDER BY f.SEQNO
    81     </Sql>
    81     </Sql>
    82     <Parameter name="adLanguage"/>
    82     <Parameter name="adLanguage"/>
    83     <Parameter name="tab"/>    
    83     <Parameter name="tab"/>    
    84   </SqlMethod>
    84   </SqlMethod>
    86     <SqlMethodComment>Names of the columns and name of the fields of a tab</SqlMethodComment>
    86     <SqlMethodComment>Names of the columns and name of the fields of a tab</SqlMethodComment>
    87     <Sql>
    87     <Sql>
    88       SELECT AD_AUXILIARINPUT_ID as reference, name as realname, name as columnname, name as name, 
    88       SELECT AD_AUXILIARINPUT_ID as reference, name as realname, name as columnname, name as name, 
    89       code as defaultValue, 'x' as xmltext, '' as WHERECLAUSE
    89       code as defaultValue, 'x' as xmltext, '' as WHERECLAUSE
    90       FROM ad_auxiliarinput 
    90       FROM ad_auxiliarinput 
    91       WHERE ad_tab_id = to_number(?)
    91       WHERE ad_tab_id = ?
    92     </Sql>
    92     </Sql>
    93     <Parameter name="sql" optional="true" after="WHERE " text="code LIKE ? || '%' AND "/>
    93     <Parameter name="sql" optional="true" after="WHERE " text="code LIKE ? || '%' AND "/>
    94     <Parameter name="tab"/>
    94     <Parameter name="tab"/>
    95   </SqlMethod>
    95   </SqlMethod>
    96   <SqlMethod name="tabName" type="preparedStatement" return="string">
    96   <SqlMethod name="tabName" type="preparedStatement" return="string">
    97     <SqlMethodComment>Name of the tab</SqlMethodComment>
    97     <SqlMethodComment>Name of the tab</SqlMethodComment>
    98     <Sql>
    98     <Sql>
    99         SELECT Name FROM ad_tab
    99         SELECT Name FROM ad_tab
   100         WHERE ad_tab_id = to_number(?)
   100         WHERE ad_tab_id = ?
   101     </Sql>
   101     </Sql>
   102     <Parameter name="tab"/>
   102     <Parameter name="tab"/>
   103   </SqlMethod>
   103   </SqlMethod>
   104   <SqlMethod name="windowName" type="preparedStatement" return="string">
   104   <SqlMethod name="windowName" type="preparedStatement" return="string">
   105       <SqlMethodComment>Name of the window</SqlMethodComment>
   105       <SqlMethodComment>Name of the window</SqlMethodComment>
   106       <Sql>
   106       <Sql>
   107         SELECT ad_window.Name FROM ad_tab, ad_window
   107         SELECT ad_window.Name FROM ad_tab, ad_window
   108         WHERE ad_window.ad_window_id = ad_tab.ad_window_id and ad_tab_id = to_number(?)
   108         WHERE ad_window.ad_window_id = ad_tab.ad_window_id and ad_tab_id = ?
   109       </Sql>
   109       </Sql>
   110       <Parameter name="tab"/>
   110       <Parameter name="tab"/>
   111   </SqlMethod>
   111   </SqlMethod>
   112   <SqlMethod name="tableKeyColumnName" type="preparedStatement" return="multiple">
   112   <SqlMethod name="tableKeyColumnName" type="preparedStatement" return="multiple">
   113       <SqlMethodComment>Name of the column key of the tab</SqlMethodComment>
   113       <SqlMethodComment>Name of the column key of the tab</SqlMethodComment>
   133       <SqlMethodComment>Name of the column key of the tab</SqlMethodComment>
   133       <SqlMethodComment>Name of the column key of the tab</SqlMethodComment>
   134       <Sql><![CDATA[
   134       <Sql><![CDATA[
   135         SELECT ColumnName As Name, issecondarykey FROM ad_table, ad_column, ad_tab 
   135         SELECT ColumnName As Name, issecondarykey FROM ad_table, ad_column, ad_tab 
   136         WHERE ad_table.ad_table_id = ad_column.ad_table_id
   136         WHERE ad_table.ad_table_id = ad_column.ad_table_id
   137           AND ad_tab.ad_table_id = ad_table.ad_table_id
   137           AND ad_tab.ad_table_id = ad_table.ad_table_id
   138           AND ad_tab_id = to_number(?) 
   138           AND ad_tab_id = ? 
   139           and (iskey='Y' OR isSecondaryKey='Y')
   139           and (iskey='Y' OR isSecondaryKey='Y')
   140           AND ad_column.ColumnName <> ? 
   140           AND ad_column.ColumnName <> ? 
   141           ORDER BY (CASE iskey WHEN 'Y' THEN 1 ELSE 2 END)
   141           ORDER BY (CASE iskey WHEN 'Y' THEN 1 ELSE 2 END)
   142       ]]></Sql>
   142       ]]></Sql>
   143       <Parameter name="tab"/>
   143       <Parameter name="tab"/>
   146   <SqlMethod name="parentsColumnNameSortTab" type="preparedStatement" return="multiple">
   146   <SqlMethod name="parentsColumnNameSortTab" type="preparedStatement" return="multiple">
   147       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   147       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   148       <Sql><![CDATA[
   148       <Sql><![CDATA[
   149         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   149         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   150         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   150         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   151         AND AD_TAB.ad_tab_id=to_number(?)) AS tablename 
   151         AND AD_TAB.ad_tab_id=?) AS tablename 
   152         FROM AD_FIELD, AD_COLUMN 
   152         FROM AD_FIELD, AD_COLUMN 
   153         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id AND ad_table_id = to_number(?) AND isParent='Y' 
   153         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id AND ad_table_id = ? AND isParent='Y' 
   154       ]]></Sql>
   154       ]]></Sql>
   155       <Parameter name="parentTab"/>
   155       <Parameter name="parentTab"/>
   156       <Parameter name="adTableId"/>
   156       <Parameter name="adTableId"/>
   157   </SqlMethod>
   157   </SqlMethod>
   158   <SqlMethod name="parentsColumnName" type="preparedStatement" return="multiple">
   158   <SqlMethod name="parentsColumnName" type="preparedStatement" return="multiple">
   159       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   159       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   160       <Sql><![CDATA[
   160       <Sql><![CDATA[
   161         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   161         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   162         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   162         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   163         AND AD_TAB.ad_tab_id=to_number(?)) AS tablename, to_number(?) as AD_Tab_ID, (select name from ad_tab where ad_tab_id = to_NUMBER(?)) as parent_tab_name
   163         AND AD_TAB.ad_tab_id=?) AS tablename, ? as AD_Tab_ID, (select name from ad_tab where ad_tab_id = ?) as parent_tab_name
   164         FROM AD_FIELD, AD_COLUMN 
   164         FROM AD_FIELD, AD_COLUMN 
   165         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id AND ad_tab_id = to_number(?) AND isParent='Y' 
   165         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id AND ad_tab_id = ? AND isParent='Y' 
   166         AND EXISTS(SELECT 1 FROM AD_COLUMN c, AD_FIELD f WHERE c.ad_column_id = f.ad_column_id AND (c.iskey='Y' OR c.issecondarykey='Y')
   166         AND EXISTS(SELECT 1 FROM AD_COLUMN c, AD_FIELD f WHERE c.ad_column_id = f.ad_column_id AND (c.iskey='Y' OR c.issecondarykey='Y')
   167         AND ad_tab_id=to_number(?) AND UPPER(c.columnname) = UPPER(AD_COLUMN.columnname))
   167         AND ad_tab_id=? AND UPPER(c.columnname) = UPPER(AD_COLUMN.columnname))
   168       ]]></Sql>
   168       ]]></Sql>
   169       <Parameter name="parentTab"/>
   169       <Parameter name="parentTab"/>
   170       <Parameter name="parentTab"/>
   170       <Parameter name="parentTab"/>
   171       <Parameter name="parentTab"/>
   171       <Parameter name="parentTab"/>
   172       <Parameter name="tab"/>
   172       <Parameter name="tab"/>
   175   <SqlMethod name="parentsColumnReal" type="preparedStatement" return="multiple">
   175   <SqlMethod name="parentsColumnReal" type="preparedStatement" return="multiple">
   176       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   176       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   177       <Sql>
   177       <Sql>
   178         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   178         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   179         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   179         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   180         AND AD_TAB.ad_tab_id=to_number(?)) AS tablename 
   180         AND AD_TAB.ad_tab_id=?) AS tablename
   181         FROM AD_FIELD, AD_COLUMN 
   181         FROM AD_FIELD, AD_COLUMN 
   182         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id AND ad_tab_id = to_number(?)
   182         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id AND ad_tab_id = ?
   183         AND UPPER(columnname) IN (SELECT UPPER(columnname) FROM AD_FIELD, AD_COLUMN 
   183         AND UPPER(columnname) IN (SELECT UPPER(columnname) FROM AD_FIELD, AD_COLUMN 
   184         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   184         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   185         AND AD_COLUMN.iskey='Y' 
   185         AND AD_COLUMN.iskey='Y' 
   186         AND AD_FIELD.ad_tab_id=to_number(?))
   186         AND AD_FIELD.ad_tab_id=?)
   187       </Sql>
   187       </Sql>
   188       <Parameter name="parentTab"/>
   188       <Parameter name="parentTab"/>
   189       <Parameter name="tab"/>
   189       <Parameter name="tab"/>
   190       <Parameter name="parentTab"/>
   190       <Parameter name="parentTab"/>
   191   </SqlMethod>
   191   </SqlMethod>
   192   <SqlMethod name="parentsColumnRealAll" type="preparedStatement" return="multiple">
   192   <SqlMethod name="parentsColumnRealAll" type="preparedStatement" return="multiple">
   193       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   193       <SqlMethodComment>Name of the columns parent of the tab</SqlMethodComment>
   194       <Sql>
   194       <Sql>
   195         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   195         SELECT ColumnName AS NAME, AD_REFERENCE_id AS reference, ad_reference_value_id AS referencevalue,
   196         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   196         (SELECT tableNAME FROM AD_TABLE, AD_TAB WHERE AD_TABLE.ad_table_id = AD_TAB.ad_table_id
   197         AND AD_TAB.ad_tab_id=to_number(?)) AS tablename 
   197         AND AD_TAB.ad_tab_id=?) AS tablename 
   198         FROM AD_FIELD, AD_COLUMN 
   198         FROM AD_FIELD, AD_COLUMN 
   199         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   199         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   200         AND ad_tab_id = to_number(?) 
   200         AND ad_tab_id = ? 
   201         AND isparent='Y'
   201         AND isparent='Y'
   202         order by ad_column.seqno
   202         order by ad_column.seqno
   203       </Sql>
   203       </Sql>
   204       <Parameter name="parentTab"/>
   204       <Parameter name="parentTab"/>
   205       <Parameter name="tab"/>
   205       <Parameter name="tab"/>
   210         SELECT ad_field.name As Name, ad_field_trl.name as columnname 
   210         SELECT ad_field.name As Name, ad_field_trl.name as columnname 
   211           FROM ad_field left join ad_field_trl on ad_field.ad_field_id = ad_field_trl.ad_field_id 
   211           FROM ad_field left join ad_field_trl on ad_field.ad_field_id = ad_field_trl.ad_field_id 
   212                                               and ad_field_trl.ad_language = ?, 
   212                                               and ad_field_trl.ad_language = ?, 
   213                ad_column 
   213                ad_column 
   214         WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   214         WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   215         and ad_table_id = to_number(?) and isParent='Y' 
   215         and ad_table_id = ? and isParent='Y' 
   216       ]]></Sql>
   216       ]]></Sql>
   217       <Parameter name="adLanguage"/>
   217       <Parameter name="adLanguage"/>
   218       <Parameter name="table"/>
   218       <Parameter name="table"/>
   219   </SqlMethod>
   219   </SqlMethod>
   220   <SqlMethod name="parentsColumnDisplayName" type="preparedStatement" return="multiple">
   220   <SqlMethod name="parentsColumnDisplayName" type="preparedStatement" return="multiple">
   223         SELECT ad_field.name As Name, ad_field_trl.name as columnname 
   223         SELECT ad_field.name As Name, ad_field_trl.name as columnname 
   224           FROM ad_field left join ad_field_trl on ad_field.ad_field_id = ad_field_trl.ad_field_id 
   224           FROM ad_field left join ad_field_trl on ad_field.ad_field_id = ad_field_trl.ad_field_id 
   225                                               and ad_field_trl.ad_language = ?, 
   225                                               and ad_field_trl.ad_language = ?, 
   226                ad_column 
   226                ad_column 
   227         WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   227         WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   228         and ad_tab_id = to_number(?) and isParent='Y' 
   228         and ad_tab_id = ? and isParent='Y' 
   229         and exists(select 1 from ad_column c, ad_field f where c.ad_column_id = f.ad_column_id and c.iskey='Y'
   229         and exists(select 1 from ad_column c, ad_field f where c.ad_column_id = f.ad_column_id and c.iskey='Y'
   230         and ad_tab_id=to_number(?) and UPPER(c.columnname) = UPPER(ad_column.columnname))
   230         and ad_tab_id=? and UPPER(c.columnname) = UPPER(ad_column.columnname))
   231       ]]></Sql>
   231       ]]></Sql>
   232       <Parameter name="adLanguage"/>
   232       <Parameter name="adLanguage"/>
   233       <Parameter name="tab"/>
   233       <Parameter name="tab"/>
   234       <Parameter name="parentTab"/>
   234       <Parameter name="parentTab"/>
   235   </SqlMethod>
   235   </SqlMethod>
   239         SELECT ad_field.Name AS NAME, AD_FIELD_TRL.NAME AS COLUMNNAME
   239         SELECT ad_field.Name AS NAME, AD_FIELD_TRL.NAME AS COLUMNNAME
   240         FROM AD_FIELD left join AD_FIELD_TRL on AD_FIELD.AD_FIELD_ID = AD_FIELD_TRL.AD_FIELD_ID
   240         FROM AD_FIELD left join AD_FIELD_TRL on AD_FIELD.AD_FIELD_ID = AD_FIELD_TRL.AD_FIELD_ID
   241                                             AND AD_FIELD_TRL.AD_LANGUAGE = ? , 
   241                                             AND AD_FIELD_TRL.AD_LANGUAGE = ? , 
   242              AD_COLUMN 
   242              AD_COLUMN 
   243         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   243         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   244         AND ad_tab_id = to_number(?)
   244         AND ad_tab_id = ?
   245         AND UPPER(columnname) IN (SELECT UPPER(columnname) FROM AD_FIELD, AD_COLUMN 
   245         AND UPPER(columnname) IN (SELECT UPPER(columnname) FROM AD_FIELD, AD_COLUMN 
   246         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   246         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   247         AND AD_COLUMN.iskey='Y' 
   247         AND AD_COLUMN.iskey='Y' 
   248         AND AD_FIELD.ad_tab_id=to_number(?))
   248         AND AD_FIELD.ad_tab_id=?)
   249       </Sql>
   249       </Sql>
   250       <Parameter name="adLanguage"/>
   250       <Parameter name="adLanguage"/>
   251       <Parameter name="tab"/>
   251       <Parameter name="tab"/>
   252       <Parameter name="parentTab"/>
   252       <Parameter name="parentTab"/>
   253   </SqlMethod>
   253   </SqlMethod>
   257         SELECT ad_field.Name AS NAME, AD_FIELD_TRL.NAME AS COLUMNNAME
   257         SELECT ad_field.Name AS NAME, AD_FIELD_TRL.NAME AS COLUMNNAME
   258         FROM AD_FIELD left join AD_FIELD_TRL on AD_FIELD.AD_FIELD_ID = AD_FIELD_TRL.AD_FIELD_ID 
   258         FROM AD_FIELD left join AD_FIELD_TRL on AD_FIELD.AD_FIELD_ID = AD_FIELD_TRL.AD_FIELD_ID 
   259                                             AND AD_FIELD_TRL.AD_LANGUAGE = ? ,
   259                                             AND AD_FIELD_TRL.AD_LANGUAGE = ? ,
   260              AD_COLUMN 
   260              AD_COLUMN 
   261         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   261         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id 
   262         AND ad_tab_id = to_number(?)
   262         AND ad_tab_id = ?
   263         AND isparent='Y'
   263         AND isparent='Y'
   264         ORDER BY AD_Column.SEQNO
   264         ORDER BY AD_Column.SEQNO
   265       </Sql>
   265       </Sql>
   266       <Parameter name="adLanguage"/>
   266       <Parameter name="adLanguage"/>
   267       <Parameter name="tab"/>
   267       <Parameter name="tab"/>
   268   </SqlMethod>
   268   </SqlMethod>
   269   <SqlMethod name="tableName" type="preparedStatement" return="string">
   269   <SqlMethod name="tableName" type="preparedStatement" return="string">
   270       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   270       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   271       <Sql>
   271       <Sql>
   272         SELECT ad_table.TABLEName FROM ad_tab, ad_table
   272         SELECT ad_table.TABLEName FROM ad_tab, ad_table
   273         WHERE ad_table.ad_table_id = ad_tab.ad_table_id and ad_tab_id = to_number(?)
   273         WHERE ad_table.ad_table_id = ad_tab.ad_table_id and ad_tab_id = ?
   274       </Sql>
   274       </Sql>
   275       <Parameter name="tab"/>
   275       <Parameter name="tab"/>
   276   </SqlMethod>
   276   </SqlMethod>
   277   <SqlMethod name="tabNameTrl" type="preparedStatement" return="string">
   277   <SqlMethod name="tabNameTrl" type="preparedStatement" return="string">
   278       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   278       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   279       <Sql>
   279       <Sql>
   280         SELECT (CASE WHEN ad_tab_trl.Name IS NULL THEN '*' || ad_tab.Name ELSE ad_tab_trl.Name END) as NAME 
   280         SELECT (CASE WHEN ad_tab_trl.Name IS NULL THEN '*' || ad_tab.Name ELSE ad_tab_trl.Name END) as NAME 
   281           FROM ad_tab left join ad_tab_trl on  ad_tab.ad_tab_id = ad_tab_trl.ad_tab_id
   281           FROM ad_tab left join ad_tab_trl on  ad_tab.ad_tab_id = ad_tab_trl.ad_tab_id
   282                                           and ad_tab_trl.isactive = 'Y'
   282                                           and ad_tab_trl.isactive = 'Y'
   283                                           and ad_tab_trl.ad_language = ?
   283                                           and ad_tab_trl.ad_language = ?
   284         WHERE ad_tab.ad_tab_id = to_number(?)        
   284         WHERE ad_tab.ad_tab_id = ?        
   285       </Sql>
   285       </Sql>
   286       <Parameter name="adLanguage"/>
   286       <Parameter name="adLanguage"/>
   287       <Parameter name="tab"/>      
   287       <Parameter name="tab"/>      
   288   </SqlMethod>
   288   </SqlMethod>
   289   <SqlMethod name="windowNameTrl" type="preparedStatement" return="string">
   289   <SqlMethod name="windowNameTrl" type="preparedStatement" return="string">
   292         SELECT (CASE WHEN ad_window_trl.Name IS NULL THEN '*' || ad_window.Name ELSE ad_window_trl.Name END) as NAME 
   292         SELECT (CASE WHEN ad_window_trl.Name IS NULL THEN '*' || ad_window.Name ELSE ad_window_trl.Name END) as NAME 
   293           FROM ad_tab, ad_window left join ad_window_trl on ad_window.ad_window_id = ad_window_trl.ad_window_id 
   293           FROM ad_tab, ad_window left join ad_window_trl on ad_window.ad_window_id = ad_window_trl.ad_window_id 
   294                                                         and ad_window_trl.isactive = 'Y'
   294                                                         and ad_window_trl.isactive = 'Y'
   295                                                         and ad_window_trl.ad_language = ?
   295                                                         and ad_window_trl.ad_language = ?
   296         WHERE ad_tab.ad_window_id = ad_window.ad_window_id 
   296         WHERE ad_tab.ad_window_id = ad_window.ad_window_id 
   297         and ad_tab.ad_tab_id = to_number(?)
   297         and ad_tab.ad_tab_id = ?
   298         
   298         
   299       </Sql>
   299       </Sql>
   300       <Parameter name="adLanguage"/>
   300       <Parameter name="adLanguage"/>
   301       <Parameter name="tab"/>      
   301       <Parameter name="tab"/>      
   302   </SqlMethod>
   302   </SqlMethod>
   305     <Sql><![CDATA[
   305     <Sql><![CDATA[
   306       SELECT ColumnName As Name, '?' AS Xml_Format, ad_column.ad_reference_id as reference, 
   306       SELECT ColumnName As Name, '?' AS Xml_Format, ad_column.ad_reference_id as reference, 
   307       ad_column.ad_reference_value_id as referencevalue FROM ad_field, ad_column 
   307       ad_column.ad_reference_value_id as referencevalue FROM ad_field, ad_column 
   308       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   308       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   309       and UPPER(ad_column.columnname) not in ('CREATED', 'UPDATED', 'CREATEDBY', 'UPDATEDBY') 
   309       and UPPER(ad_column.columnname) not in ('CREATED', 'UPDATED', 'CREATEDBY', 'UPDATEDBY') 
   310       and ad_tab_id = to_number(?) 
   310       and ad_tab_id = ? 
   311       AND upper(ad_column.columnname) <> 'BINARYDATA' 
   311       AND upper(ad_column.columnname) <> 'BINARYDATA' 
   312       AND ad_column.isEncrypted <> 'Y'
   312       AND ad_column.isEncrypted <> 'Y'
   313       AND ad_column.isactive = 'Y'
   313       AND ad_column.isactive = 'Y'
   314       ORDER BY ad_field.SEQNO
   314       ORDER BY ad_field.SEQNO
   315     ]]></Sql>
   315     ]]></Sql>
   321       SELECT ColumnName As Name, 'x' as xmltext, ad_reference_value_id as referencevalue, ColumnName as NameRef, ad_table.tablename 
   321       SELECT ColumnName As Name, 'x' as xmltext, ad_reference_value_id as referencevalue, ColumnName as NameRef, ad_table.tablename 
   322       FROM ad_field, ad_column, ad_table
   322       FROM ad_field, ad_column, ad_table
   323       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   323       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   324         and ad_column.ad_table_id = ad_table.ad_table_id 
   324         and ad_column.ad_table_id = ad_table.ad_table_id 
   325         and ad_field.ISDISPLAYED = 'Y'
   325         and ad_field.ISDISPLAYED = 'Y'
   326         AND ad_tab_id = to_number(?)
   326         AND ad_tab_id = ?
   327         AND ad_reference_id = 17
   327         AND ad_reference_id = '17'
   328     </Sql>
   328     </Sql>
   329     <Parameter name="tab"/>
   329     <Parameter name="tab"/>
   330   </SqlMethod>
   330   </SqlMethod>
   331   <SqlMethod name="selectTables" type="preparedStatement" return="multiple">
   331   <SqlMethod name="selectTables" type="preparedStatement" return="multiple">
   332     <SqlMethodComment>Fields of reference table in a tab</SqlMethodComment>
   332     <SqlMethodComment>Fields of reference table in a tab</SqlMethodComment>
   339           ad_ref_table, ad_table 
   339           ad_ref_table, ad_table 
   340       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   340       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   341       AND ad_ref_table.ad_table_id = ad_table.ad_table_id 
   341       AND ad_ref_table.ad_table_id = ad_table.ad_table_id 
   342       AND ad_column.AD_REFERENCE_VALUE_ID = ad_ref_table.AD_REFERENCE_ID  
   342       AND ad_column.AD_REFERENCE_VALUE_ID = ad_ref_table.AD_REFERENCE_ID  
   343       and ad_field.ISDISPLAYED = 'Y'
   343       and ad_field.ISDISPLAYED = 'Y'
   344       AND ad_tab_id = to_number(?) 
   344       AND ad_tab_id = ? 
   345       AND ad_column.ad_reference_id = 18
   345       AND ad_column.ad_reference_id = '18'
   346     </Sql>
   346     </Sql>
   347     <Parameter name="tab"/>
   347     <Parameter name="tab"/>
   348   </SqlMethod>
   348   </SqlMethod>
   349   <SqlMethod name="selectTableDirs" type="preparedStatement" return="multiple">
   349   <SqlMethod name="selectTableDirs" type="preparedStatement" return="multiple">
   350     <SqlMethodComment>Fields of reference table in a tab</SqlMethodComment>
   350     <SqlMethodComment>Fields of reference table in a tab</SqlMethodComment>
   354       'TableDir' as tablenametrl, '' as WHERECLAUSE, '19' as reference, ad_column.istranslated 
   354       'TableDir' as tablenametrl, '' as WHERECLAUSE, '19' as reference, ad_column.istranslated 
   355       FROM ad_field, ad_column left join ad_val_rule on ad_column.AD_VAL_RULE_ID = ad_val_rule.AD_VAL_RULE_ID , ad_table 
   355       FROM ad_field, ad_column left join ad_val_rule on ad_column.AD_VAL_RULE_ID = ad_val_rule.AD_VAL_RULE_ID , ad_table 
   356       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   356       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   357       and ad_column.ad_table_id = ad_table.ad_table_id 
   357       and ad_column.ad_table_id = ad_table.ad_table_id 
   358       and ad_field.ISDISPLAYED = 'Y'
   358       and ad_field.ISDISPLAYED = 'Y'
   359       AND ad_tab_id = to_number(?) 
   359       AND ad_tab_id = ? 
   360       AND ad_reference_id = 19
   360       AND ad_reference_id = '19'
   361     </Sql>
   361     </Sql>
   362     <Parameter name="tab"/>
   362     <Parameter name="tab"/>
   363   </SqlMethod>
   363   </SqlMethod>
   364   <SqlMethod name="columnIdentifier" type="preparedStatement" return="string">
   364   <SqlMethod name="columnIdentifier" type="preparedStatement" return="string">
   365       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   365       <SqlMethodComment>Name of the table of the tab</SqlMethodComment>
   398     <Sql>
   398     <Sql>
   399       <![CDATA[
   399       <![CDATA[
   400       SELECT ColumnName As Name
   400       SELECT ColumnName As Name
   401       FROM ad_field, ad_column
   401       FROM ad_field, ad_column
   402       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   402       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   403         AND ad_tab_id = to_number(?)
   403         AND ad_tab_id = ?
   404         AND ad_field.SORTNO is not null
   404         AND ad_field.SORTNO is not null
   405       ORDER BY ad_field.SORTNO, ad_field.SEQNO
   405       ORDER BY ad_field.SORTNO, ad_field.SEQNO
   406       ]]>
   406       ]]>
   407     </Sql>
   407     </Sql>
   408     <Parameter name="tab"/>
   408     <Parameter name="tab"/>
   411     <SqlMethodComment>isSOTrx of the window</SqlMethodComment>
   411     <SqlMethodComment>isSOTrx of the window</SqlMethodComment>
   412     <Sql>
   412     <Sql>
   413       <![CDATA[
   413       <![CDATA[
   414       SELECT isSOTrx FROM AD_WINDOW, AD_TAB 
   414       SELECT isSOTrx FROM AD_WINDOW, AD_TAB 
   415       WHERE AD_TAB.AD_WINDOW_ID = AD_WINDOW.AD_WINDOW_ID 
   415       WHERE AD_TAB.AD_WINDOW_ID = AD_WINDOW.AD_WINDOW_ID 
   416       AND AD_TAB.AD_TAB_ID = to_number(?)
   416       AND AD_TAB.AD_TAB_ID = ?
   417       ]]>
   417       ]]>
   418     </Sql>
   418     </Sql>
   419     <Parameter name="tab"/>
   419     <Parameter name="tab"/>
   420   </SqlMethod>
   420   </SqlMethod>
   421   <SqlMethod name="selectDefaultValue" type="preparedStatement" return="multiple">
   421   <SqlMethod name="selectDefaultValue" type="preparedStatement" return="multiple">
   429       isdisplayed, ad_column.columnname as columnname, ad_table.ACCESSLEVEL, 
   429       isdisplayed, ad_column.columnname as columnname, ad_table.ACCESSLEVEL, 
   430       ad_table.TABLENAME as NameRef, ad_reference_value_id as type, ad_column.name as realname
   430       ad_table.TABLENAME as NameRef, ad_reference_value_id as type, ad_column.name as realname
   431       FROM ad_field, ad_column, ad_table
   431       FROM ad_field, ad_column, ad_table
   432       WHERE ad_field.ad_column_id = ad_column.ad_column_id
   432       WHERE ad_field.ad_column_id = ad_column.ad_column_id
   433 	  	AND ad_column.AD_TABLE_ID = ad_table.AD_TABLE_ID 
   433 	  	AND ad_column.AD_TABLE_ID = ad_table.AD_TABLE_ID 
   434         AND ad_tab_id = to_number(?) 
   434         AND ad_tab_id = ? 
   435         AND upper(ad_column.columnname) <> 'BINARYDATA' 
   435         AND upper(ad_column.columnname) <> 'BINARYDATA' 
   436       ORDER BY ad_field.SEQNO
   436       ORDER BY ad_field.SEQNO
   437       ]]>
   437       ]]>
   438     </Sql>
   438     </Sql>
   439     <Parameter name="sql" optional="true" after="WHERE " text="ad_column.defaultvalue LIKE ? || '%' AND "/>
   439     <Parameter name="sql" optional="true" after="WHERE " text="ad_column.defaultvalue LIKE ? || '%' AND "/>
   448         ismandatory as required, isDisplayed as isdisplayed, isupdateable as isupdateable,
   448         ismandatory as required, isDisplayed as isdisplayed, isupdateable as isupdateable,
   449         ad_column.defaultvalue As defaultValue, ad_column.fieldlength As fieldLength,
   449         ad_column.defaultvalue As defaultValue, ad_column.fieldlength As fieldLength,
   450         ad_field.displaylength, REPLACE(replace(REPLACE(REPLACE(AD_ELEMENT.columnname, 'Substitute_ID', 'M_Product_ID'), 'C_Settlement_Cancel_ID', 'C_Settlement_ID'), 'BOM_ID', '_ID'), 'M_LocatorTo_ID', 'M_Locator_ID') as columnname
   450         ad_field.displaylength, REPLACE(replace(REPLACE(REPLACE(AD_ELEMENT.columnname, 'Substitute_ID', 'M_Product_ID'), 'C_Settlement_Cancel_ID', 'C_Settlement_ID'), 'BOM_ID', '_ID'), 'M_LocatorTo_ID', 'M_Locator_ID') as columnname
   451       FROM ad_field, ad_column left join ad_element on ad_column.ad_element_id = ad_element.ad_element_id
   451       FROM ad_field, ad_column left join ad_element on ad_column.ad_element_id = ad_element.ad_element_id
   452       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   452       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   453         AND ad_tab_id = to_number(?)
   453         AND ad_tab_id = ?
   454         AND (ad_column.ISSESSIONATTR = 'Y' 
   454         AND (ad_column.ISSESSIONATTR = 'Y' 
   455         OR ad_column.iskey = 'Y') 
   455         OR ad_column.iskey = 'Y') 
   456         AND upper(ad_column.columnname) <> 'BINARYDATA' 
   456         AND upper(ad_column.columnname) <> 'BINARYDATA' 
   457         AND ad_column.ColumnName <> 'Created'
   457         AND ad_column.ColumnName <> 'Created'
   458       ORDER BY ad_field.SEQNO
   458       ORDER BY ad_field.SEQNO
   469       isdisplayed, ad_column.columnname as columnname, ad_table.ACCESSLEVEL, 
   469       isdisplayed, ad_column.columnname as columnname, ad_table.ACCESSLEVEL, 
   470       ad_table.TABLENAME as NameRef, '' as realname
   470       ad_table.TABLENAME as NameRef, '' as realname
   471       FROM ad_field, ad_column, ad_table
   471       FROM ad_field, ad_column, ad_table
   472       WHERE ad_field.ad_column_id = ad_column.ad_column_id
   472       WHERE ad_field.ad_column_id = ad_column.ad_column_id
   473 	  	AND ad_column.AD_TABLE_ID = ad_table.AD_TABLE_ID 
   473 	  	AND ad_column.AD_TABLE_ID = ad_table.AD_TABLE_ID 
   474         AND ad_tab_id = to_number(?) 
   474         AND ad_tab_id = ? 
   475         and isParent='N'
   475         and isParent='N'
   476         and ad_column.columnname = 'DocumentNo'
   476         and ad_column.columnname = 'DocumentNo'
   477         and ad_column.defaultvalue is null
   477         and ad_column.defaultvalue is null
   478       ORDER BY ad_field.SEQNO
   478       ORDER BY ad_field.SEQNO
   479       ]]>
   479       ]]>
   582     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   582     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   583     <Sql>
   583     <Sql>
   584       <![CDATA[
   584       <![CDATA[
   585       SELECT ishighvolume FROM AD_TAB, AD_TABLE 
   585       SELECT ishighvolume FROM AD_TAB, AD_TABLE 
   586       WHERE AD_TAB.ad_table_id = AD_TABLE.ad_table_id
   586       WHERE AD_TAB.ad_table_id = AD_TABLE.ad_table_id
   587       AND AD_TAB.ad_tab_id=to_number(?)
   587       AND AD_TAB.ad_tab_id=?
   588       ]]>
   588       ]]>
   589     </Sql>
   589     </Sql>
   590     <Parameter name="tab"/>
   590     <Parameter name="tab"/>
   591   </SqlMethod>
   591   </SqlMethod>
   592   <SqlMethod name="isSingleRow" type="preparedStatement" return="String">
   592   <SqlMethod name="isSingleRow" type="preparedStatement" return="String">
   593     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   593     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   594     <Sql>
   594     <Sql>
   595       <![CDATA[
   595       <![CDATA[
   596       SELECT issinglerow FROM AD_TAB 
   596       SELECT issinglerow FROM AD_TAB 
   597       WHERE ad_tab_id=to_number(?)
   597       WHERE ad_tab_id=?
   598       ]]>
   598       ]]>
   599     </Sql>
   599     </Sql>
   600     <Parameter name="tab"/>
   600     <Parameter name="tab"/>
   601   </SqlMethod>
   601   </SqlMethod>
   602   <SqlMethod name="hasCreateFromButton" type="preparedStatement" return="String" default="0">
   602   <SqlMethod name="hasCreateFromButton" type="preparedStatement" return="String" default="0">
   603     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   603     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   604     <Sql>
   604     <Sql>
   605       <![CDATA[
   605       <![CDATA[
   606         SELECT coalesce(ad_column.ad_process_id, -1) AS total 
   606         SELECT coalesce(ad_column.ad_process_id, '-1') AS total 
   607         FROM AD_FIELD, AD_COLUMN, AD_TABLE
   607         FROM AD_FIELD, AD_COLUMN, AD_TABLE
   608         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id
   608         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id
   609         AND AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID 
   609         AND AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID 
   610         AND ad_tab_id = to_number(?) 
   610         AND ad_tab_id = ? 
   611         AND AD_COLUMN.ad_reference_id = 28
   611         AND AD_COLUMN.ad_reference_id = '28'
   612         AND AD_COLUMN.COLUMNNAME = 'CreateFrom'
   612         AND AD_COLUMN.COLUMNNAME = 'CreateFrom'
   613         AND AD_COLUMN.AD_PROCESS_ID IS NULL
   613         AND AD_COLUMN.AD_PROCESS_ID IS NULL
   614         AND AD_FIELD.ISDISPLAYED = 'Y'
   614         AND AD_FIELD.ISDISPLAYED = 'Y'
   615       ]]>
   615       ]]>
   616     </Sql>
   616     </Sql>
   618   </SqlMethod>
   618   </SqlMethod>
   619   <SqlMethod name="hasPostedButton" type="preparedStatement" return="String" default="0">
   619   <SqlMethod name="hasPostedButton" type="preparedStatement" return="String" default="0">
   620     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   620     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   621     <Sql>
   621     <Sql>
   622       <![CDATA[
   622       <![CDATA[
   623         SELECT coalesce(ad_column.ad_process_id, -1) AS total 
   623         SELECT coalesce(ad_column.ad_process_id, '-1') AS total 
   624         FROM AD_FIELD, AD_COLUMN, AD_TABLE
   624         FROM AD_FIELD, AD_COLUMN, AD_TABLE
   625         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id
   625         WHERE AD_FIELD.ad_column_id = AD_COLUMN.ad_column_id
   626         AND AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID 
   626         AND AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID 
   627         AND ad_tab_id = to_number(?) 
   627         AND ad_tab_id = ? 
   628         AND AD_COLUMN.ad_reference_id = 28
   628         AND AD_COLUMN.ad_reference_id = '28'
   629         AND AD_COLUMN.COLUMNNAME = 'Posted'
   629         AND AD_COLUMN.COLUMNNAME = 'Posted'
   630         AND AD_COLUMN.AD_PROCESS_ID IS NULL
   630         AND AD_COLUMN.AD_PROCESS_ID IS NULL
   631         AND AD_FIELD.ISDISPLAYED = 'Y'
   631         AND AD_FIELD.ISDISPLAYED = 'Y'
   632       ]]>
   632       ]]>
   633     </Sql>
   633     </Sql>
   640         SELECT c.ad_column_id as id, c.columnname, t.WHERECLAUSE as whereClause, v.code as referencevalue, c.ad_reference_id as reference,
   640         SELECT c.ad_column_id as id, c.columnname, t.WHERECLAUSE as whereClause, v.code as referencevalue, c.ad_reference_id as reference,
   641         c.ad_reference_value_id as NameRef, c.ad_val_rule_id as defaultvalue, f.isdisplayed, c.istranslated, c.columnname as name,
   641         c.ad_reference_value_id as NameRef, c.ad_val_rule_id as defaultvalue, f.isdisplayed, c.istranslated, c.columnname as name,
   642         (case when t.whereclause is not null or v.code is not null then 'C' else 'R' end) as type /*Combo reaload or Reference*/ 
   642         (case when t.whereclause is not null or v.code is not null then 'C' else 'R' end) as type /*Combo reaload or Reference*/ 
   643         FROM AD_FIELD f, 
   643         FROM AD_FIELD f, 
   644              AD_COLUMN c left join  AD_VAL_RULE v on c.AD_VAL_RULE_ID = v.AD_VAL_RULE_ID
   644              AD_COLUMN c left join  AD_VAL_RULE v on c.AD_VAL_RULE_ID = v.AD_VAL_RULE_ID
   645                          left join AD_REF_TABLE t on (CASE c.ad_reference_id WHEN 18 THEN c.AD_REFERENCE_VALUE_ID ELSE 0 END) = t.AD_REFERENCE_ID     
   645                          left join AD_REF_TABLE t on (CASE c.ad_reference_id WHEN '18' THEN c.AD_REFERENCE_VALUE_ID ELSE '0' END) = t.AD_REFERENCE_ID     
   646         WHERE f.AD_COLUMN_ID = c.ad_column_id
   646         WHERE f.AD_COLUMN_ID = c.ad_column_id
   647         AND f.ad_tab_id = to_number(?) 
   647         AND f.ad_tab_id = ? 
   648         AND (t.whereclause IS NOT NULL
   648         AND (t.whereclause IS NOT NULL
   649             OR v.code IS NOT NULL
   649             OR v.code IS NOT NULL
   650             OR c.ad_reference_id in (19,18,17))
   650             OR c.ad_reference_id in ('19','18','17'))
   651       ]]>
   651       ]]>
   652     </Sql>
   652     </Sql>
   653     <Parameter name="tab"/>
   653     <Parameter name="tab"/>
   654   </SqlMethod>
   654   </SqlMethod>
   655   <SqlMethod name="selectColumnTable" type="preparedStatement" return="multiple">
   655   <SqlMethod name="selectColumnTable" type="preparedStatement" return="multiple">
   662       FROM ad_field, ad_column left join ad_val_rule on ad_column.AD_VAL_RULE_ID = ad_val_rule.AD_VAL_RULE_ID, ad_ref_table, ad_table 
   662       FROM ad_field, ad_column left join ad_val_rule on ad_column.AD_VAL_RULE_ID = ad_val_rule.AD_VAL_RULE_ID, ad_ref_table, ad_table 
   663       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   663       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   664       AND ad_ref_table.ad_table_id = ad_table.ad_table_id 
   664       AND ad_ref_table.ad_table_id = ad_table.ad_table_id 
   665       AND ad_column.AD_REFERENCE_VALUE_ID = ad_ref_table.AD_REFERENCE_ID  
   665       AND ad_column.AD_REFERENCE_VALUE_ID = ad_ref_table.AD_REFERENCE_ID  
   666       and ad_field.ISDISPLAYED = 'Y'
   666       and ad_field.ISDISPLAYED = 'Y'
   667       AND ad_field.ad_tab_id = to_number(?)
   667       AND ad_field.ad_tab_id = ?
   668       AND ad_column.ad_column_id = to_number(?) 
   668       AND ad_column.ad_column_id = ? 
   669       AND ad_column.ad_reference_id = 18
   669       AND ad_column.ad_reference_id = '18'
   670     </Sql>
   670     </Sql>
   671     <Parameter name="adTabId"/>
   671     <Parameter name="adTabId"/>
   672     <Parameter name="adColumnId"/>
   672     <Parameter name="adColumnId"/>
   673   </SqlMethod>
   673   </SqlMethod>
   674   <SqlMethod name="selectColumnTableDir" type="preparedStatement" return="multiple">
   674   <SqlMethod name="selectColumnTableDir" type="preparedStatement" return="multiple">
   679       'TableDir' as tablenametrl, '' as WHERECLAUSE, '19' as reference, ad_column.istranslated 
   679       'TableDir' as tablenametrl, '' as WHERECLAUSE, '19' as reference, ad_column.istranslated 
   680       FROM ad_field, ad_column left join ad_val_rule on ad_column.AD_VAL_RULE_ID = ad_val_rule.AD_VAL_RULE_ID , ad_table 
   680       FROM ad_field, ad_column left join ad_val_rule on ad_column.AD_VAL_RULE_ID = ad_val_rule.AD_VAL_RULE_ID , ad_table 
   681       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   681       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   682       and ad_column.ad_table_id = ad_table.ad_table_id 
   682       and ad_column.ad_table_id = ad_table.ad_table_id 
   683       and ad_field.ISDISPLAYED = 'Y'
   683       and ad_field.ISDISPLAYED = 'Y'
   684       AND ad_field.ad_tab_id = to_number(?)
   684       AND ad_field.ad_tab_id = ?
   685       AND ad_column.ad_column_id = to_number(?) 
   685       AND ad_column.ad_column_id = ? 
   686       AND ad_reference_id = 19
   686       AND ad_reference_id = '19'
   687     </Sql>
   687     </Sql>
   688     <Parameter name="adTabId"/>
   688     <Parameter name="adTabId"/>
   689     <Parameter name="adColumnId"/>
   689     <Parameter name="adColumnId"/>
   690   </SqlMethod>
   690   </SqlMethod>
   691   <SqlMethod name="columnName" type="preparedStatement" return="String" default="">
   691   <SqlMethod name="columnName" type="preparedStatement" return="String" default="">
   692     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   692     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   693     <Sql>
   693     <Sql>
   694       <![CDATA[
   694       <![CDATA[
   695       SELECT columnname FROM AD_column 
   695       SELECT columnname FROM AD_column 
   696       WHERE ad_column_id= to_number(?)
   696       WHERE ad_column_id=?
   697       ]]>
   697       ]]>
   698     </Sql>
   698     </Sql>
   699     <Parameter name="adColumnId"/>
   699     <Parameter name="adColumnId"/>
   700   </SqlMethod>
   700   </SqlMethod>
   701   <SqlMethod name="selectIdentify" type="preparedStatement" return="multiple">
   701   <SqlMethod name="selectIdentify" type="preparedStatement" return="multiple">
   707       isdisplayed, ad_column.columnname as columnname, ad_table.ACCESSLEVEL, 
   707       isdisplayed, ad_column.columnname as columnname, ad_table.ACCESSLEVEL, 
   708       ad_table.TABLENAME as NameRef, '' as realname, ad_column.ISSESSIONATTR, ad_column.istranslated 
   708       ad_table.TABLENAME as NameRef, '' as realname, ad_column.ISSESSIONATTR, ad_column.istranslated 
   709       FROM ad_field, ad_column, ad_table
   709       FROM ad_field, ad_column, ad_table
   710       WHERE ad_field.ad_column_id = ad_column.ad_column_id
   710       WHERE ad_field.ad_column_id = ad_column.ad_column_id
   711 	  	AND ad_column.AD_TABLE_ID = ad_table.AD_TABLE_ID 
   711 	  	AND ad_column.AD_TABLE_ID = ad_table.AD_TABLE_ID 
   712         AND ad_tab_id = to_number(?) 
   712         AND ad_tab_id = ? 
   713         and ismandatory='Y' 
   713         and ismandatory='Y' 
   714         AND upper(ad_column.columnname) = 'VALUE'
   714         AND upper(ad_column.columnname) = 'VALUE'
   715       ORDER BY ad_field.SEQNO
   715       ORDER BY ad_field.SEQNO
   716       ]]>
   716       ]]>
   717     </Sql>
   717     </Sql>
   721     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   721     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   722     <Sql>
   722     <Sql>
   723       <![CDATA[
   723       <![CDATA[
   724       SELECT whereclause
   724       SELECT whereclause
   725       FROM ad_tab
   725       FROM ad_tab
   726       WHERE ad_tab_id = to_number(?) 
   726       WHERE ad_tab_id = ? 
   727       ]]>
   727       ]]>
   728     </Sql>
   728     </Sql>
   729     <Parameter name="tab"/>
   729     <Parameter name="tab"/>
   730   </SqlMethod>
   730   </SqlMethod>
   731   <SqlMethod name="hasEncryptionFields" type="preparedStatement" return="String" default="0">
   731   <SqlMethod name="hasEncryptionFields" type="preparedStatement" return="String" default="0">
   732     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   732     <SqlMethodComment>Names of the columns of the fields of a tab</SqlMethodComment>
   733     <Sql>
   733     <Sql>
   734       <![CDATA[
   734       <![CDATA[
   735         SELECT count(*) AS total 
   735         SELECT count(*) AS total 
   736         FROM AD_FIELD, AD_COLUMN
   736         FROM AD_FIELD, AD_COLUMN
   737         WHERE AD_FIELD.ad_tab_id = to_number(?) 
   737         WHERE AD_FIELD.ad_tab_id = ? 
   738         AND ad_field.ad_column_id = ad_column.ad_column_id 
   738         AND ad_field.ad_column_id = ad_column.ad_column_id 
   739         AND ad_column.isEncrypted = 'Y' 
   739         AND ad_column.isEncrypted = 'Y' 
   740         AND ad_field.ISDISPLAYED = 'Y'
   740         AND ad_field.ISDISPLAYED = 'Y'
   741       ]]>
   741       ]]>
   742     </Sql>
   742     </Sql>
   749       SELECT ad_field.ad_field_id as id, ad_column.ColumnName, ad_column.ColumnName as realName, ad_column.ColumnName as Name, ad_column.isDesencryptable, '' AS Xml_Format, '' as htmltext 
   749       SELECT ad_field.ad_field_id as id, ad_column.ColumnName, ad_column.ColumnName as realName, ad_column.ColumnName as Name, ad_column.isDesencryptable, '' AS Xml_Format, '' as htmltext 
   750       FROM ad_field, ad_column
   750       FROM ad_field, ad_column
   751       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   751       WHERE ad_field.ad_column_id = ad_column.ad_column_id 
   752         AND ad_column.isEncrypted = 'Y' 
   752         AND ad_column.isEncrypted = 'Y' 
   753         AND ad_field.ISDISPLAYED = 'Y'
   753         AND ad_field.ISDISPLAYED = 'Y'
   754         AND ad_tab_id = to_number(?)
   754         AND ad_tab_id = ?
   755       ORDER BY ad_field.SEQNO
   755       ORDER BY ad_field.SEQNO
   756       ]]>
   756       ]]>
   757     </Sql>
   757     </Sql>
   758     <Parameter name="tab"/>
   758     <Parameter name="tab"/>
   759   </SqlMethod>
   759   </SqlMethod>
   762     <Sql>
   762     <Sql>
   763       <![CDATA[
   763       <![CDATA[
   764       select ad_reference_value_id as id, columnname, columnname || '_BTN' as realName 
   764       select ad_reference_value_id as id, columnname, columnname || '_BTN' as realName 
   765       from ad_field f, ad_column c
   765       from ad_field f, ad_column c
   766       where f.ad_column_id = c.ad_column_id 
   766       where f.ad_column_id = c.ad_column_id 
   767       and f.ad_tab_id = to_number(?)
   767       and f.ad_tab_id = ?
   768       and f.isactive = 'Y'
   768       and f.isactive = 'Y'
   769       and f.isdisplayed = 'Y'
   769       and f.isdisplayed = 'Y'
   770       and c.isactive = 'Y'
   770       and c.isactive = 'Y'
   771       and ad_reference_value_id is not null
   771       and ad_reference_value_id is not null
   772       and c.ad_reference_id = 28 
   772       and c.ad_reference_id = '28' 
   773       and c.columnname <> 'ChangeProjectStatus'
   773       and c.columnname <> 'ChangeProjectStatus'
   774       ]]>
   774       ]]>
   775     </Sql>
   775     </Sql>
   776     <Parameter name="tab"/>
   776     <Parameter name="tab"/>
   777   </SqlMethod>
   777   </SqlMethod>
   780     <Sql>
   780     <Sql>
   781       <![CDATA[
   781       <![CDATA[
   782       select count(*) as actionButtons
   782       select count(*) as actionButtons
   783       from ad_field f, ad_column c
   783       from ad_field f, ad_column c
   784       where f.ad_column_id = c.ad_column_id 
   784       where f.ad_column_id = c.ad_column_id 
   785       and f.ad_tab_id = to_number(?)
   785       and f.ad_tab_id = ?
   786       and f.isactive = 'Y'
   786       and f.isactive = 'Y'
   787       and f.isdisplayed = 'Y'
   787       and f.isdisplayed = 'Y'
   788       and c.isactive = 'Y'
   788       and c.isactive = 'Y'
   789       and ad_reference_value_id is not null
   789       and ad_reference_value_id is not null
   790       and c.ad_reference_id = 28 
   790       and c.ad_reference_id = '28' 
   791       ]]>
   791       ]]>
   792     </Sql>
   792     </Sql>
   793     <Parameter name="tab"/>
   793     <Parameter name="tab"/>
   794   </SqlMethod>
   794   </SqlMethod>
   795   <SqlMethod name="hasButtonList" type="preparedStatement" return="String" default="0">
   795   <SqlMethod name="hasButtonList" type="preparedStatement" return="String" default="0">
   797     <Sql>
   797     <Sql>
   798       <![CDATA[
   798       <![CDATA[
   799           select count(*) as total
   799           select count(*) as total
   800         from ad_field f,
   800         from ad_field f,
   801              ad_column c
   801              ad_column c
   802        where f.ad_tab_id = to_number(?)
   802        where f.ad_tab_id = ?
   803          and f.ad_column_id = c.ad_column_id
   803          and f.ad_column_id = c.ad_column_id
   804          and ad_reference_id = 28
   804          and ad_reference_id = '28'
   805          and ad_reference_value_id is not null
   805          and ad_reference_value_id is not null
   806          and f.isdisplayed = 'Y'
   806          and f.isdisplayed = 'Y'
   807          and f.isactive='Y'
   807          and f.isactive='Y'
   808       ]]>
   808       ]]>
   809     </Sql>
   809     </Sql>
   814     <Sql>
   814     <Sql>
   815       <![CDATA[
   815       <![CDATA[
   816           select count(*) as total
   816           select count(*) as total
   817         from ad_field f,
   817         from ad_field f,
   818              ad_column c
   818              ad_column c
   819        where f.ad_tab_id = to_number(?)
   819        where f.ad_tab_id = ?
   820          and f.ad_column_id = c.ad_column_id
   820          and f.ad_column_id = c.ad_column_id
   821          and ad_reference_id = 28
   821          and ad_reference_id = '28'
   822          and f.isdisplayed = 'Y'
   822          and f.isdisplayed = 'Y'
   823          and f.isactive='Y'
   823          and f.isactive='Y'
   824       ]]>
   824       ]]>
   825     </Sql>
   825     </Sql>
   826     <Parameter name="tab"/>
   826     <Parameter name="tab"/>