Home » Developer & Programmer » Forms » how to use if condition in the button
how to use if condition in the button [message #620527] Mon, 04 August 2014 00:42 Go to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Hi all,

WBP Button:--
DECLARE 
alert_button NUMBER; 
BEGIN 
   	alert_button := Show_Alert('ABC'); 
	    IF alert_button = ALERT_BUTTON1 THEN 
	         submit_accept; -->This ONE
	         commit;
	    END IF; 
END; 

IN this code , i need TO ADD IF conditon LIKE below

IF :BLOCK.type_id=1234 THEN
   submit_set;
   commit;
END if;
Re: how to use if condition in the button [message #620530 is a reply to message #620527] Mon, 04 August 2014 01:33 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Why are you not using block name? You can using following code:

If :System.Cursor_Block = 'My_Block' Then
Submit_Set;
Commit;
End If;
Re: how to use if condition in the button [message #620538 is a reply to message #620530] Mon, 04 August 2014 02:43 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
From the code posted I have no idea what's stopping you from just adding the IF statement.
Re: how to use if condition in the button [message #620565 is a reply to message #620538] Mon, 04 August 2014 06:14 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:
From the code posted I have no idea what's stopping you from just adding the IF statement.

sorry for the late reply, we have called one program "submit_accept" without condition, and next i need to write and call "submit_set"(this is based on condition) like if a=1 then call submit_set program(created in the program units)


thanks
Re: how to use if condition in the button [message #620581 is a reply to message #620565] Mon, 04 August 2014 07:42 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'm assuming that after all this time spent writing oracle forms you know how to:
a) write a basic IF statement.
b) call a procedure.

That being the case, what, exactly, is stopping you from writing the code you need?
Re: how to use if condition in the button [message #620583 is a reply to message #620581] Mon, 04 August 2014 07:47 Go to previous messageGo to next message
mist598
Messages: 1195
Registered: February 2013
Location: Hyderabad
Senior Member
Quote:

a) write a basic IF statement.
b) call a procedure.

That being the case, what, exactly, is stopping you from writing the code you need?


But it is not effect my requirement and i have written like below
DECLARE 
alert_button NUMBER; 
BEGIN 
   	alert_button := Show_Alert('ABC'); 
	    IF alert_button = ALERT_BUTTON1 THEN 
	         submit_accept; -->This ONE
	         commit;
             ELSIF:BLOCK.type_id=1234 THEN
                submit_set;
              commit;
             END if;

Re: how to use if condition in the button [message #620587 is a reply to message #620583] Mon, 04 August 2014 08:44 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
So does that code do what you need?
Previous Topic: Oracle Forms (6i) Calendar
Next Topic: SQL NOT TO COMMIT
Goto Forum:
  


Current Time: Fri Apr 19 15:21:16 CDT 2024