1.將目標ITEM的子類信息設置爲List,不須要添加列表中元素,不須要初始值。
2.新建一個Procedure,代碼以下:sql
PROCEDURE basis_list(event IN VARCHAR2) IS --遊標中定義List中顯示的值和數據庫值 CURSOR c_list IS SELECT lookup_code, meaning FROM fnd_lookup_values_vl WHERE lookup_type = 'HSS_QT_BASIS'; i NUMBER := 0; l_value VARCHAR2(10); l_meaning VARCHAR2(20); BEGIN IF event = 'INIT' THEN --賦值前,清空List中現有的值 clear_list('QT_NAME.BASIS'); FOR r_list IN c_list LOOP l_value := r_list.lookup_code; l_meaning := r_list.meaning; i := i + 1; -- add_list_element有4個參數依次爲,Item名稱,列表中值的序列,顯示的值,數據庫值 add_list_element('QT_NAME.BASIS', i, l_meaning, l_value); END LOOP; END IF; END basis_list;
3.在WHEN-NEW-FORM-INSTANCE中調用procedure作初始化數據庫
PROCEDURE create_index_method_list(item_name in varchar2, record_group_name in varchar2) IS-- i number; BEGIN i := populate_group(record_group_name); clear_list(item_name); if i = 0 then populate_list(item_name, record_group_name); end if; END;2.在WHEN-NEW-FORM-INSTANCE中調用procedure作初始化