Thursday, January 13, 2022

Oracle Forms Dropdown List Item values populated from database table

 

Oracle Forms Dropdown List Item values populated from database table

Step 1:

Create the drop down list in “Data blocks” section.

In my case:

·                     The name of the drop down list is “APP”.

Oracle Forms Dropdown List Item values populated from database table


Step 2:

Second step is go to the program unit and create the procedure with any name.

In my case:

·                     The procedure name is List_down.


Oracle Forms Dropdown List Item values populated from database table


Step 3:

After you've completed the procedure, you may move on to the next step. Open it and put the code below into it.

PROCEDURE list_DOWN Is

GROUP_ID   RECORDGROUP;

LIST_ID    ITEM := FIND_ITEM('LIST.APP');

STATUS NUMBER;

BEGIN

GROUP_ID := FIND_GROUP('TYP');

IF NOT ID_NULL(GROUP_ID) THEN

DELETE_GROUP(GROUP_ID);

ELSE

GROUP_ID := CREATE_GROUP_FROM_QUERY

('TYP','SELECT ename,to_char(empno) FROM EMP');

END IF;

STATUS := POPULATE_GROUP('TYP');

POPULATE_LIST(LIST_ID,GROUP_ID);

END;

Oracle Forms Dropdown List Item values populated from database table



Step 4:

Go to the Form level trigger and create trigger “WHEN-NEW-FORM-INSTANCE”.

Oracle Forms Dropdown List Item values populated from database table

Step 5:

Open the trigger and call the procedure we created with the name of “LIST_DOWN” in the “WHEN-NEW-FORM-INSTANCE” trigger.

Oracle Forms Dropdown List Item values populated from database table


Step 6:

After all the step will done. Compile the form “ Ctrl + Shift + K” and then run the Form

·                     the form shortcut key to run the “Ctrl + R”.

·                     Also run the form in the toolbar


Oracle Forms Dropdown List Item values populated from database table

Output:


Oracle Forms Dropdown List Item values populated from database table

If you have any problem so download the file to click on "Download".

I hope it's helpful for you. If you have any queries, don't hesitate to contact me.

Name : Muhammad Sahal Qasim
E-mail : s.m.sahal789@gmail.com
Thank you.

0 comments:

Post a Comment

If you have any doubts, please let me know. I will help you.