Oracle Form Save Notification

i'm working for oracle db 10g , form 6i
when i'm posting data in the form then i need to save the record
message from orcale comes in the back of the form run time as menstioned in the image
telling me that record commit , or error
i want this message to appear in the form itself to see it , how i can do that
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helena Markováprogrammer-analystCommented:
You can do this:
1. create alert - AL_MESSAGE (alert style Note)

2. create a procedure MSG:

PROCEDURE MSG(txt in varchar2) IS
n number;
  n := show_alert('AL_MESSAGE');

3. In ON-MESSAGE and ON-ERROR triggers on form level you can call procedure MSG:

ON-MESSAGE trigger:
MSG(message_code || chr(10)|| message_text);

ON-ERROR trigger:
MSG(error_code || chr(10)|| error_text);

I hope this will be a little help for you.
NiceMan331Author Commented:
OK , this works well
but if i don't' want to show the error as message , i want to display it in a text box
Helena Markováprogrammer-analystCommented:
In triggers you can test error_code or message_code (these codes you can find in the on-line help in description of each FRM-xxxxxx message - the code is xxxxx) and display/not display alert or alert with customized text.

e.g.  for ON-MESSAGE trigger:
IF message_code = 41800 THEN
message(message_text); -- -- message will be displayed in the status bar
ELSIF message_code in (40353, 40301) then
   null; -- message will not be displayed
MSG(message_code || chr(10)|| message_text);  -- message will be displayed in alert

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

NiceMan331Author Commented:
now one thing , i will search for message code of commit
but i need the message to be alert only when i press f10
because some commit by code within the form i dont need to alert me
Helena Markováprogrammer-analystCommented:
In such a case you can set :system.message_level to 20 before using commit in form code (this will suppress messages which level is below 20). Error messages cannot be suppressed.

:system.message_level := 20;
:system.message_level := 5;
NiceMan331Author Commented:
when i did , no alert at all received , either in the form , neither when F10
Helena Markováprogrammer-analystCommented:
How are changes saved ? What does it mean - "because some commit by code within the form i dont need to alert me" ?
NiceMan331Author Commented:
when i added the last code regarding message level
the commit done , but no alert
Helena Markováprogrammer-analystCommented:
:system.message_level := 20;  -- this line suppresses messages below level 20
 commit; -- commit without message
:system.message_level := 5; -- this line set message level to the lower value = 5, so every message will be displayed

You can put these 3 lines to the places where you use commit (or COMMIT_FORM)  and want to suppress messages.
NiceMan331Author Commented:
that is exactly what i did
except i have commit_form instead of commit
Helena Markováprogrammer-analystCommented:
So it is all right: there are no messages (alert), because messages which level is lower than 20 are suppressed.

This is from the on-line help:

SYSTEM.MESSAGE_LEVEL stores one of the following message severity levels: 0, 5, 10, 15, 20, or 25. The default value is 0.

SYSTEM.MESSAGE_LEVEL can be set to either a character string or a number. The values assigned can be any value between 0 and 25, but values lower than 0 or higher than 25 will generate an error.

During a Runform session, Oracle Forms suppresses all messages with a severity level that is the same or lower (less severe) than the indicated severity level.

Assign a value to the SYSTEM.MESSAGE_LEVEL system variable with standard PL/SQL syntax:

:System.Message_Level := value;

The legal values for SYSTEM.MESSAGE_LEVEL are 0, 5, 10, 15, 20,and 25. Oracle Forms does not suppress prompts or vital error messages, no matter what severity level you select.

Assume that you want Oracle Forms to display only the most severe messages (level 25). The following Pre-Form trigger suppresses all messages at levels 20 and below. :System.Message_Level := '20';

What is problem ?
NiceMan331Author Commented:
i agree with you , but i really i don't know what happened
any how , if no more suggest , i will accept your answer & close it
waiting for your last comment
thanx alot
Helena Markováprogrammer-analystCommented:
If you remove all settings of :System.Message_Level, then all messages will be displayed.

You can also store system.message_level to a variable, set it before commit_form to the desired level and then set it back to its origin value.

v_msg_level := :system.message_level;
:system.message_level := 0; -- all messages will be displayed
 :system.message_level := v_msg_level;
NiceMan331Author Commented:
yes now correct
but after i changed the value to be 20

v_msg_level := :system.message_level;
:system.message_level :=20; -- all messages will be displayed
 :system.message_level := v_msg_level; 

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.