Home » Developer & Programmer » Forms » how to use many set_block_property - default_where property in one form
how to use many set_block_property - default_where property in one form [message #356290] |
Thu, 30 October 2008 04:01  |
clarenz_25
Messages: 3 Registered: October 2008
|
Junior Member |
|
|
hi
i am using oracle forms and in my program i need to filter the data that is displayed on the tabular form. i used SET_BLOCK_PROPERTY(BLOCK NAME,PROPERTY,VALUE) to filter the data and i used a button to control the filtering. i also used the trigger - when-button-pressed. But after i pressed the butoon a dialog box appears on the screen asking me if i wan to save the chages.
- if i pressed the Yes button the right query appears then
another dialog box appears on the screen telling me that
transaction complete: 1 records applied and saved.
then there is an OK button. when you pressed it.
wrong query displays on the screen or all the data
is displayed
- if i pressed the No button the right query apppears.
the problem here is i want to remove the dialog box when i pressed the button and automatically display the right output or data. i would like to ask some help about my problem. here are the codes i used in this program.
begin
if :status_item1 is null then
if :month_item1 is null then
if :year_item1 is null then
SET_BLOCK_PROPERTY('FLT_ISP',default_where,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and (substr(SYS_DATE,8,2)= substr(SYSDATE,8,2) and substr(sys_date,4,3)=substr(sysdate,4,3))');
go_block('FLT_ISP');
execute_query;
else
SET_BLOCK_PROPERTY('FLT_ISP',default_where,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and SUBSTR(SYS_DATE,8,2)= NVL(:YEAR_ITEM1,SUBSTR(SYSDATE,8,2)) and (substr(sys_date,4,3)=substr(sysdate,4,3))');
go_block('FLT_ISP');
execute_query;
end if;
else
if :year_item1 is null then
SET_BLOCK_PROPERTY('FLT_ISP',default_where,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and (substr(SYS_DATE,8,2)= substr(SYSDATE,8,2) AND SUBSTR(SYS_DATE,4,3)= NVL(:MONTH_ITEM1,SUBSTR(SYSDATE,4,3))');
go_block('FLT_ISP');
Execute_query;
else
SET_BLOCK_PROPERTY('FLT_ISP',default_where,'ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT and SUBSTR(SYS_DATE,8,2)= NVL(:YEAR_ITEM1,SUBSTR(SYSDATE,8,2)) AND SUBSTR(SYS_DATE,4,3)= NVL(:MONTH_ITEM1,SUBSTR(SYSDATE,4,3))');
go_block('FLT_ISP');
execute_query;
end if;
end if;
else
if :month_item1 is null then
if :year_item1 is null then
SET_BLOCK_PROPERTY('FLT_ISP',DEFAULT_WHERE,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and STATUS =NVL(:STATUS_ITEM1,status) and (substr(SYS_DATE,8,2)= substr(SYSDATE,8,2) and substr(sys_date,4,3)=substr(sysdate,4,3))');
go_block('FLT_ISP');
execute_query;
else
SET_BLOCK_PROPERTY('FLT_ISP',default_where,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and STATUS =NVL(:STATUS_ITEM1,status) and SUBSTR(SYS_DATE,8,2)= NVL(:YEAR_ITEM1,SUBSTR(SYSDATE,8,2)) and (substr(sys_date,4,3)=substr(sysdate,4,3))');
go_block('FLT_ISP');
execute_query;
end if;
else
if :year_item1 is null then
SET_BLOCK_PROPERTY('FLT_ISP',onetime_where,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and STATUS =NVL(:STATUS_ITEM1,status) and (substr(SYS_DATE,8,2)= substr(SYSDATE,8,2) AND SUBSTR(SYS_DATE,4,3)= NVL(:MONTH_ITEM1,SUBSTR(SYSDATE,4,3)) and substr(sys_date,4,3)=substr(sysdate,4,3))');
go_block('FLT_ISP');
execute_query;
Else
SET_BLOCK_PROPERTY('FLT_ISP',onetime_where,'(ENTERED_BY=:GLOBAL.ID_NUMBER OR IMP_DEPT= :GLOBAL.DEPARTMENT) and STATUS =NVL(:STATUS_ITEM1,status) and SUBSTR(SYS_DATE,8,2)= NVL(:YEAR_ITEM1,SUBSTR(SYSDATE,8,2)) AND SUBSTR(SYS_DATE,4,3)= NVL(:MONTH_ITEM1,SUBSTR(SYSDATE,4,3))');
go_block('FLT_ISP');
execute_query;
end if;
end if;
end if;
end;
-
Attachment: filtering.JPG
(Size: 66.10KB, Downloaded 21729 times)
|
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 21:56:34 CDT 2025
|