Home » Developer & Programmer » Forms » PB_CANCEL masterbutton
PB_CANCEL masterbutton [message #563656] Thu, 16 August 2012 06:32 Go to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
my problem is with cancel masterbutton, when i clear form through this cancel masterbutton it clear the form. but after this when i click on show button it is not working, although show button is working correctly before pressing cancel_query masterbutton. what should i consider for correct working.

for help i'm uploading my form
  • Attachment: debar_reg.fmb
    (Size: 224.00KB, Downloaded 1014 times)
Re: PB_CANCEL masterbutton [message #563684 is a reply to message #563656] Thu, 16 August 2012 08:28 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't have Forms installation so I can't open the FMB you attached. However, for people who might want to do that, what Forms version do you use? (How come you didn't fill that information when creating this topic?)

What does "cancel masterbutton" do, exactly? Does it - apart from clearing the form (how? CLEAR_FORM?) - set other items' properties? If so, does it have anything to do with "show button"?
Re: PB_CANCEL masterbutton [message #563773 is a reply to message #563684] Fri, 17 August 2012 00:03 Go to previous messageGo to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
i am using 10g form version.
my coding on cancel button is just only to clear the form as:
clear_form(no_validate);

and in property
current record visual attribute group: null

and my coding on show button is:
declare
	qry varchar(200);
begin
	

		if :control.regno is not null and :control.name is not null and :control.reason is null and :control.qtr_type is null then
 		Message('Kindly select either Regno or Name.');Message(' ');	
 			clear_form(no_validate);
 		raise form_trigger_failure;
		end if;
		
------------------------------if all null then-----------------------------------------------------------------------------------
   if :control.regno is  null and :control.reason is  null and :control.name is  null and :control.qtr_type is  null then
	   go_block('DEBAR_REG_VU');
	   clear_block(no_validate);
     execute_query;
  end if;
--------------------------------------------------------------
   if :control.regno is not null and :control.reason is  null and :control.name is null and :control.qtr_type is  null then
	   qry := 'regno=:control.regno';	
		 go_block('DEBAR_REG_VU');
		 clear_block(no_validate);
     set_block_property('DEBAR_REG_VU', default_where,qry);
     execute_query;
   end if;
----------------------------------------------------------------
   if :control.name is not null and :control.regno is  null and :control.reason is  null and :control.qtr_type is  null then
	     qry := 'name like ''%'||:control.name||'%'' order by regno ';	
       go_block('DEBAR_REG_VU');
       clear_block(no_validate);
       set_block_property('DEBAR_REG_VU', default_where,qry);
       execute_query;
   end if;
----------------------------------------------------------------
   if :control.reason is not  null and :control.regno is  null and :control.name is null and :control.qtr_type is  null then
	     qry := 'reason=:control.reason order by regno ';	
		   go_block('DEBAR_REG_VU');
		   clear_block(no_validate);
       set_block_property('DEBAR_REG_VU', default_where,qry);
       execute_query;
   end if;
----------------------------------------------------------------
    if :control.qtr_type is not null and :control.regno is  null and :control.reason is  null and :control.name is null then
	     qry := 'qtr_type=:control.qtr_type order by regno ';	
	     go_block('DEBAR_REG_VU');
	     clear_block(no_validate);
       set_block_property('DEBAR_REG_VU', default_where,qry);
       execute_query;
    end if;
----------------------------------------------------------------

   if :control.qtr_type is not null and :control.reason is not null and :control.regno is  null and :control.name is null then
	   qry := 'qtr_type=:control.qtr_type and reason=:control.reason order by regno ';	
		 go_block('DEBAR_REG_VU');
		 clear_block(no_validate);
     set_block_property('DEBAR_REG_VU', default_where,qry);
     execute_query;
	 end if;   
-----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------	
if :control.debar_over='YES' then
		
		if :control.regno is  null and :control.reason is  null and :control.name is  null and :control.qtr_type is  null then
	    qry:= ' debtodt<sysdate order by regno ';
	  	go_block('DEBAR_REG_VU');
	  	clear_block(no_validate);
      set_block_property('DEBAR_REG_VU', default_where,qry);
      execute_query;
    end if;
--------------------------------------------------------------
  
   if :control.reason is not  null and :control.regno is  null and :control.name is null and :control.qtr_type is  null then
	  qry := 'reason=:control.reason and debtodt<sysdate order by regno ';	
		go_block('DEBAR_REG_VU');
		clear_block(no_validate);
   	set_block_property('DEBAR_REG_VU', default_where,qry);
    execute_query;
   end if;
----------------------------------------------------------------

   if :control.qtr_type is not null and :control.regno is  null and :control.reason is  null and :control.name is null then
	  qry := 'qtr_type=:control.qtr_type and debtodt<sysdate order by regno ';	
		go_block('DEBAR_REG_VU');
		clear_block(no_validate);
    set_block_property('DEBAR_REG_VU', default_where,qry);
    execute_query;
   end if;

  if :control.qtr_type is not null and :control.reason is not null and :control.regno is  null and :control.name is null then
	   qry := ' qtr_type=:control.qtr_type and reason=:control.reason and debtodt<sysdate order by regno ';	
		 go_block('DEBAR_REG_VU');
		 clear_block(no_validate);
     set_block_property('DEBAR_REG_VU', default_where,qry);
     execute_query;
	 end if; 
 
 end if;	
-------------------------------------------------------------------------------------------------------	
-------------------------------------------------------------------------------------------------------
if :control.debar_over='NO' then
		
		if :control.regno is  null and :control.reason is  null and :control.name is  null and :control.qtr_type is  null then
	   qry := ' debtodt>=sysdate ';	
		 go_block('DEBAR_REG_VU');
		 clear_block(no_validate);
     set_block_property('DEBAR_REG_VU', default_where,qry);
     execute_query;
    end if;
--------------------------------------------------------------

   if :control.reason is not  null and :control.regno is  null and :control.name is null and :control.qtr_type is  null then
	  qry := 'reason=:control.reason and  debtodt>=sysdate order by regno ';	
		go_block('DEBAR_REG_VU');
		clear_block(no_validate);
   	set_block_property('DEBAR_REG_VU', default_where,qry);
    execute_query;
   end if;
----------------------------------------------------------------

   if :control.qtr_type is not null and :control.regno is  null and :control.reason is  null and :control.name is null then
	  qry := 'qtr_type=:control.qtr_type and  debtodt>=sysdate order by regno ';	
		go_block('DEBAR_REG_VU');
		clear_block(no_validate);
    set_block_property('DEBAR_REG_VU', default_where,qry);
    execute_query;
   end if;
   
----------------------------------------------------------------   
    if :control.qtr_type is not null and :control.reason is not null and :control.regno is  null and :control.name is null then
	   qry := ' qtr_type=:control.qtr_type and reason=:control.reason and debtodt>=sysdate order by regno ';	
		 go_block('DEBAR_REG_VU');
		 clear_block(no_validate);
     set_block_property('DEBAR_REG_VU', default_where,qry);
     execute_query;
	 end if; 
	
end if;
---------------------------------------------------------------------------------------------------------------

end;

Re: PB_CANCEL masterbutton [message #563806 is a reply to message #563773] Fri, 17 August 2012 04:33 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As CLEAR_FORM clears all form items, maybe some of them were initialized (set) in PRE-FORM or WHEN-NEW-FORM-INSTANCE trigger. CLEAR_FORM deleted them too, so - maybe you should (at the beginning of the SHOW button's trigger) re-run PRE-FORM and/or WHEN-NEW-FORM-INSTANCE (or possibly some other triggers or procedures - you'll know that better).
Previous Topic: Printing PDF directly
Next Topic: Forms problem in Window 7 64 bit
Goto Forum:
  


Current Time: Fri Jul 05 21:28:59 CDT 2024