Home » Developer & Programmer » Forms » transfer data from called form to calling form
transfer data from called form to calling form [message #561624] Tue, 24 July 2012 06:37 Go to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
hi, i have two forms 1st lit_ackn on which there is ackn button through this i go to the 2nd form lit_ackn_details. in 2nd form i have two radio button accept and reject. if i don't want to go through any radio button and want to simply exit through exit masterbutton but it is not working on first click, it works on 2nd click only. and how can i send value from 2nd form to 1st form after exit.

coding of exit_code
PROCEDURE exit_code IS
BEGIN
  declare
	form_name varchar2(60);
	answer number;
	answer1 number;
	exit_function exception;
begin
	if :system.form_status='CHANGED' then
		set_alert_property('confirm_alert',title,'Save Changes');
		set_alert_property('confirm_alert',alert_message_text,'Would you like to make Changes Permanent ?');
		answer := show_alert('confirm_alert');
		if answer=ALERT_BUTTON1 then			
			do_key('commit_form');	
			IF NOT Form_Success THEN 
				    RAISE Form_Trigger_Failure; 
		  END IF; 		
			 if :system.form_status <> 'QUERY' then
				set_alert_property('confirm_alert',title,'Quit Without Saving');
				set_alert_property('confirm_alert',alert_message_text,'Errors Encountered while saving. Quit Without Saving ?');	
				answer1 := show_alert('confirm_alert');
			 	if answer1=ALERT_BUTTON1 then
				form_name:=get_application_property(current_form_name);			
				set_form_property(form_name,validation,property_false);			
				exit_form(No_Validate);
				set_form_property(form_name,validation,property_true);			
				elsif answer1=ALERT_BUTTON2 or answer1=ALERT_BUTTON3 then
					raise form_trigger_failure;							
				end if;			
			else
				form_name:=get_application_property(current_form_name);			
				set_form_property(form_name,validation,property_false);			
				exit_form;			
				set_form_property(form_name,validation,property_true);			
			end if;	
			elsif answer=ALERT_BUTTON3 then 
				raise form_trigger_failure;						
		elsif answer=ALERT_BUTTON2 then 	
			form_name:=get_application_property(current_form_name);			
			set_form_property(form_name,validation,property_false);					
			exit_form(No_Commit);
			set_form_property(form_name,validation,property_true);			
		end if;			
	else
		form_name:=get_application_property(current_form_name);			
		set_form_property(form_name,validation,property_false);		
		exit_form;	
		set_form_property(form_name,validation,property_true);			
	end if;	
	
	
end;
END;
Re: transfer data from called form to calling form [message #561629 is a reply to message #561624] Tue, 24 July 2012 06:56 Go to previous messageGo to next message
Littlefoot
Messages: 19893
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
how can i send value from 2nd form to 1st form

Two usual options are
a) parameters (preferred way)
b) global variables.

You should fix indentation; it is difficult to read such a code. However, what is the purpose of having any statement BEHIND EXIT_FORM? These won't be executed, will they?
Re: transfer data from called form to calling form [message #561632 is a reply to message #561629] Tue, 24 July 2012 07:02 Go to previous messageGo to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
can u please suggest me an example of parameters passing from 2nd to 1st form
Re: transfer data from called form to calling form [message #561633 is a reply to message #561632] Tue, 24 July 2012 07:18 Go to previous messageGo to next message
Littlefoot
Messages: 19893
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Open Forms Help; it is described in there. Also, search the board.
Re: transfer data from called form to calling form [message #561634 is a reply to message #561633] Tue, 24 July 2012 07:34 Go to previous messageGo to next message
cookiemonster
Messages: 11287
Registered: September 2008
Location: Rainy Manchester
Senior Member
Last time I checked you couldn't pass parameters back to the calling form. So global variables, or variables in a database package, would be the way to go.
Re: transfer data from called form to calling form [message #561783 is a reply to message #561634] Wed, 25 July 2012 05:02 Go to previous messageGo to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
i passed the global variables to the calling form by the
same ackn button through which i am going on the 2nd form.
my coding on ackn button is:
DECLARE
	form_name varchar2(20);
	st number;
  answer1 varchar2(5);

begin
	  :global.regno:=:evtn_ltn.regno;
    :global.hid:=:evtn_ltn.hid;
    
    :global.section:=:evtn_ltn.section;         	
    :global.douo:=:evtn_ltn.douo;
   --------if exists--------
  if :evtn_ltn.file_no is not null then 
  	
				answer1 := show_alert('reconsider');
			if 	answer1=ALERT_BUTTON1 then
			   	call_form('lit_ackn_details.fmx');
			   --	:global.file_no:=:evtn_ltn.file_no;
			   	if :evtn_ltn.reason_return is not null and :evtn_ltn.file_no is null then
		 	       delete_record;
			       last_record;
             next_record;	
           end if;
	     
	     else
					raise form_trigger_failure;							
			end if;			
  end if; 
   
   	
   ---------------------------- 
  	  form_name:=get_application_property(current_form_name);			
			set_form_property(form_name,validation,property_false); 
			
			 
        
        call_form('lit_ackn_details.fmx');
    
    	set_form_property(form_name,validation,property_true);
	
---------when return from details form then-------------------------------------------------
      :evtn_ltn.file_no:=to_char(:global.file_no);
:evtn_ltn.reason_return:=to_char(:global.reason_return);
	 
		if :evtn_ltn.reason_return is not null and :evtn_ltn.file_no is null then
		 	 delete_record;
			 last_record;
       next_record;	
    end if;
		     
		
		end;     




problem is in --------if exists-------- part that when i return back from exit button ,
file_no which is existed on 1st form is disappeared from the 1st form.

Re: transfer data from called form to calling form [message #565147 is a reply to message #561783] Fri, 31 August 2012 00:03 Go to previous messageGo to next message
CH.FOZAIB@YAHOO.COM
Messages: 5
Registered: August 2012
Location: LAHORE
Junior Member
JUST TRY OPEN_FROM INSTEAD CALL_FROM
AND MAKE A TRIGGER ON 2ND FORM TO SELECT THE VALUES FROM FIRST FROM
THIS IS VERY SIMPLE
IF YOU SHARE YOU FMB FILES THEN I CAN HELP YOU MUCH MORE

THANKS
Re: transfer data from called form to calling form [message #566739 is a reply to message #561624] Wed, 19 September 2012 00:23 Go to previous messageGo to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
these are my two forms, please have a look on this.
one another problem is when i take a case of return to concerned
section radio button and try to save it, then data saves into
database, but on form it doesn't exit from the 2nd
form(lit_ackn_details) to 1st form(litigation_ack) as the coding says
on save button, but the cursor goes to the another radio button
'accept this case' which not should be occur acording to coding.
Re: transfer data from called form to calling form [message #566740 is a reply to message #566739] Wed, 19 September 2012 00:24 Go to previous messageGo to next message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
these are my two forms, please have a look on this.
one another problem is when i take a case of return to concerned
section radio button and try to save it, then data saves into
database, but on form it doesn't exit from the 2nd
form(lit_ackn_details) to 1st form(litigation_ack) as the coding says
on save button, but the cursor goes to the another radio button
'accept this case' which not should be occur acording to coding.
Re: transfer data from called form to calling form [message #567675 is a reply to message #565147] Thu, 04 October 2012 04:02 Go to previous message
oraclehi
Messages: 41
Registered: July 2012
Location: India
Member
please give me some suggestion of below described problem both the forms are attached for your better help.
Previous Topic: Date field gets disabled when a date format is given
Next Topic: data not getting saved in database
Goto Forum:
  


Current Time: Mon Dec 22 16:50:12 CST 2014

Total time taken to generate the page: 0.15591 seconds