Home » Developer & Programmer » Forms » How to Assign LOV values to Global Variables?
How to Assign LOV values to Global Variables? [message #241326] Tue, 29 May 2007 04:41 Go to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Hi All,

I have created an LOV and want to use the Selected Item from the LOV to populate Text item, List Item, etc. It is not working properly so I have declared Global Variables in order to Return the LOV items to these variables.

When I try to set the RETURN ITEM in the LOV MAPPING PROPERTIES, it only accepts Block Items and not variables? How can I assign to the global Variables?

Thank a million
Re: How to Assign LOV values to Global Variables? [message #241334 is a reply to message #241326] Tue, 29 May 2007 05:05 Go to previous messageGo to next message
mustaf_82
Messages: 20
Registered: May 2007
Location: UAE
Junior Member
You simply create an LOV using LOV wizard in that set the field of the column in which you want to return the value.

you dont have to use global variables for it.
Re: How to Assign LOV values to Global Variables? [message #241336 is a reply to message #241334] Tue, 29 May 2007 05:10 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Thanks Mustafa,

But as mentioned this is not working with no Errors so I am thinking of storing the LOV values in Global Variables then do the following:

if :global.lov_empno is not null then
:emp_blk.empno := :global.lov_empno; -- ASSIGN TO BLOCK ITEM
:global.lov_empno := null;
end if;

Can someone tell me how to do that?

Regards
Re: How to Assign LOV values to Global Variables? [message #241339 is a reply to message #241336] Tue, 29 May 2007 05:20 Go to previous messageGo to next message
mustaf_82
Messages: 20
Registered: May 2007
Location: UAE
Junior Member
No.
Then check whether there is the data stored in the master table of which you have made the LOV.

May be you are not getting the list of values because of no data in the master table.

Once if you create the lov from lov wizard then there is no way that you dont get the values.
Re: How to Assign LOV values to Global Variables? [message #241346 is a reply to message #241339] Tue, 29 May 2007 05:51 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
I run the Form, when I pop-up the LOV, there is data and I can select an Entry from the LOV. If I double-click the entry or say OK, then the Destination Fields (Block Items assigned to the LOV values) are not being affected, no population.

I have verified all the Mappings of the LOV with the Block Items they are all OK.

What could be the reason? I thought that Global Vars will solve my issue.

Please this is urgent.
Re: How to Assign LOV values to Global Variables? [message #241351 is a reply to message #241346] Tue, 29 May 2007 06:06 Go to previous messageGo to next message
mustaf_82
Messages: 20
Registered: May 2007
Location: UAE
Junior Member
Dear,

You check once again that in which column/field you are returning the value.

OR

The alternate solution is make the convert that Item to List Item and populate the values by creating record group at runtime. You will get the result definitely.
icon14.gif  Re: How to Assign LOV values to Global Variables? [message #241631 is a reply to message #241351] Wed, 30 May 2007 04:06 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
GUYS issue is SOLVED here. THANKS TO MUSTAFA (mustaf_82) who pointed out the solution as follows:

1- NO NEED FOR GLOBAL VARIABLES
2- THE TRICK IS TO CREATE PARAMETERS for each of the Return Items of the LOV to store them in those Parameters. (so I had to MAP the LOV columns to each parameter created in the LOV property pallete).
3- I created a WHEN-BUTTON-PRESSED trigger on the button that calls the LOV with the following code:

declare
lov_return boolean;
begin
lov_return := show_lov('LOV_PENDING');
:Block_Name.item_name := :PARAMETER.PARAM_name;
.... similarly for all the rest of the form items
end;

Hope this Helps other people who might be having an issue linking the LOV with the Block ITEMS.

One down ... he he he... Laughing
Re: How to Assign LOV values to Global Variables? [message #243105 is a reply to message #241326] Wed, 06 June 2007 01:56 Go to previous message
oracleproblem
Messages: 47
Registered: May 2006
Location: Dhaka
Member
At first create a procedure

PROCEDURE CHOSE(VV_NAME in MYDEPT1.DEPTNAME%type) IS
BEGIN

:global.VVV_NAME:=VV_NAME;

END;

then go record group and pass global variable

SELECT ALL COURSEDETAILS.COURSE_NAME, COURSEDETAILS.CREDIT_HOUR, OFFEREDCOURSE.COURSE_ID, OFFEREDCOURSE.DEPTID, OFFEREDCOURSE.SEMID
FROM COURSEDETAILS, OFFEREDCOURSE,MYDEPT1,MYSEMESTER
WHERE ((OFFEREDCOURSE.COURSE_ID = COURSEDETAILS.COURSE_ID)
AND (MYSEMESTER.SEMID=OFFEREDCOURSE.SEMID)
AND (COURSEDETAILS.DEPTID = MYDEPT1.DEPTID)
AND (OFFEREDCOURSE.DEPTID = MYDEPT1.DEPTID))AND
(MYDEPT1.DEPTNAME=:global.VVV_NAME)

then call procedure your suitable place
CHOSE(:MYDEPT1.DEPTNAME);

[Updated on: Wed, 06 June 2007 02:07]

Report message to a moderator

Previous Topic: Horizontal Scroll Bar for Block Level in Forms
Next Topic: Automatically display unique ID for new record (merged)
Goto Forum:
  


Current Time: Mon Mar 10 09:20:12 CDT 2025