How To Create Library Functions To Show Alert [message #457380] |
Mon, 24 May 2010 02:50 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
rmaheshbabu
Messages: 10 Registered: April 2010 Location: INDIA
|
Junior Member |
|
|
Hi all,
Am using Oracle 10g Forms and Databse.
My form Consists data block blk_user with two items
username and password
Both user name and Password are required Fields.
When user left these items Empty To show Alert
I Created Below Procedure and Called in Form_Level ON-ERROR Trigger.
PROCEDURE pcd_io_alert IS
itm_name VARCHAR2(20);
BEGIN
IF Error_type ='FRM' AND Error_code = 40202 THEN
Message(get_item_property(NAME_IN('SYSTEM.CURSOR_item'), PROMPT_TEXT )||' Should
Not Be Empty');
SET_ALERT_PROPERTY('ALT_IO',ALERT_MESSAGE_TEXT,
(get_item_property(NAME_IN('SYSTEM.CURSOR_item'), PROMPT_TEXT ))||' Should Not
Be Empty');
itm_name := Show_alert('ALT_IO');
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;
It working fine.
Could You Tell how to call or create this procedure as Library functions and call the created library in form To Show Alert. Actually I want to create library functions to Validate and Show Alert Mesages.
Regards
R.MaheshBabu.
|
|
|
Re: How To Create Library Functions To Show Alert [message #457553 is a reply to message #457380] |
Tue, 25 May 2010 03:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
gregor
Messages: 86 Registered: March 2010 Location: Germany
|
Member |
|
|
Hi
you asked:"how to call or create this procedure as Library..."
Answer: 1.Goto OBJECTNAVIGATOR ->PL/SQL-Librarys -Create(click +)
2. Rename the Libray ( if you like); copy your Procedure into the Lib.
3. Generate the library; Save it
4. Attach it to the Forms where the procedure should be called.
( If you have item references you have to use NAME_IN / COPY Build-ins)
PS. : Is better, to check the correct input ( in your case, user/password), in when-validate-record-trigger or when-button-pressed-trigger. Because on-error is for catching all errors. I.E. IF name-in('blk_user.usr_item') is null or name_in('blk_user.passwd_item') is null then ..->s.th like your Alert
|
|
|