How to user Alert in form [message #259223] |
Tue, 14 August 2007 14:25 |
affanalim
Messages: 1 Registered: August 2007
|
Junior Member |
|
|
Hi,
I want to use Alert option in form. How i will user alert as message "Given qty is greater than stock qty"
Thank
affan
|
|
|
Re: How to user Alert in form [message #259231 is a reply to message #259223] |
Tue, 14 August 2007 15:32 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
One way is to create an alert displaying function which can be called any time you need it. It looks like this:FUNCTION ALERTF (alert_ime VARCHAR2, alert_poruka VARCHAR2)
RETURN NUMBER IS alert_dugme NUMBER;
BEGIN
set_alert_property(alert_ime, alert_message_text, alert_poruka);
alert_dugme := show_alert(alert_ime);
return alert_dugme;
END;
Then, create several alerts (those that will enable you to click only <OK>, or <OK> <Cancel>, or <Yes> <No>, or ...). Let's call one of them 'AERROR', its style is "Stop" and contains only one button with the "OK" label.
In a trigger/procedure, declare a NUMBER variable and use it to call previously created function:procedure ... is
alertgumb number;
begin
select ... into ... from ... where ...;
if l_qty > stock_qty
then
alertgumb := alertf('AERROR', 'Given qty is greater than stock qty');
raise form_trigger_failure;
end if;
end;
|
|
|
|
|
|
Re: How to user Alert in form [message #259366 is a reply to message #259327] |
Wed, 15 August 2007 05:02 |
|
vamsi kasina
Messages: 2112 Registered: October 2003 Location: Cincinnati, OH
|
Senior Member |
|
|
If at all you want to show the figures also for better understandability, then there should be two variables.'Given Quantity '||:given_qty||' is greater than Stock Quantity '||:stock_qty Then it should give as the following For Ex:
Given Quantity 160 is greater than Stock Quantity 150
Edit: I prefer to put to_char, I mean an explicit conversion.
By
Vamsi
[Updated on: Wed, 15 August 2007 05:04] Report message to a moderator
|
|
|