Home » Developer & Programmer » Forms » LOV with more than one child value issue (Oracle Forms Version 11.1.2.1.0 Win)
LOV with more than one child value issue [message #643078] Mon, 28 September 2015 12:44 Go to next message
teagemini
Messages: 5
Registered: November 2014
Location: Nova Scotia
Junior Member
I've created a form so that once a user puts in a client number, they then choose an item from the LOV list. One item on the LOV can have more than one record returned. Example: A client may have two open records in different fitness clubs so when the user chooses the fitness club option in the LOV, it will error as there are two different fitness courts open for this client. I have an error trap I put in for testing so I can carry on developing the application for now.

Ideally I would like to have another option box automatically open when there is more than one record with the list of the two fitness club names for the user to then choose and this option would be on the form. I'm a newbie in Forms and would appreciate if anyone could point me in the right direction on this. Can a dynamic LOV be created at runtime or is this not feasible?

Thank you in advance...
Re: LOV with more than one child value issue [message #643085 is a reply to message #643078] Mon, 28 September 2015 16:05 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

... once a user puts in a client number ...(who) may have two open records in different fitness clubs so when the user chooses the fitness club option in the LOV, it will error as there are two different fitness courts open for this client

What is "it" (that will error)? I presume that it is a trigger.
If so, which one and how it looks like?
What error is it? Too-many-rows, I guess.
If so, does it mean that you manually fill some items? Do they belong to the same block as "client number" and the "option" item? As you can't do it in a single SELECT ... INTO (because of the too-many-rows error), another option is to use a loop. The simplest one is a cursor FOR loop. You'll need to CREATE_RECORD, remember client number and the option chosen in the first record, copy them into new record and the fill the rest of the items.

If I was on the wrong track, could you explain it once again, possibly with some more details? A screenshot is welcome too.
Re: LOV with more than one child value issue [message #643116 is a reply to message #643085] Tue, 29 September 2015 09:26 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
Ideally I would like to have another option box automatically open when there is more than one record with the list of the two fitness club names for the user to then choose and this option would be on the form.

This is possible, but your LOV Record Group will need to be modified so that it returns a single record first. Oracle LOV objects can only return a single value. After you have fixed your LOV Record Group, I recommend you create a Key-ListVal trigger on your LOV Item to call your LOV. This allows you to check the result returned by the LOV without the restrictions of a When-Validate-Item trigger. After a value is returned by your LOV, you can then execute a query to see if the client has more than one record. If yes, display a Modal window that requires the user to select which client record to use.

This method will require you to create an additional Block, Canvas and Modal Window which will be used to display multiple client records. Next, create a procedure that sets the selected client record in the original data block. This procedure can then be called in a When-Mouse-Doubleclick trigger on the selected record and a When-Button-Pressed trigger so the user can select the record and click/press a "Selected" button to select the record.

Take a look at the "Displaying an LOV Programmatically" Help topic for more information on how to use the Key-ListVal trigger and code samples.

This is one way of doing what you want.

Craig...
Re: LOV with more than one child value issue [message #643117 is a reply to message #643116] Tue, 29 September 2015 09:43 Go to previous messageGo to next message
teagemini
Messages: 5
Registered: November 2014
Location: Nova Scotia
Junior Member
Thanks for your replies Smile CraigB, I'm going to try your method as it sounds just the solution that I'm looking for. The window will allow the user to select the record that they need and this and some other items on the form are being used to generate a custom letter in Oracle Reports. Thank you again Smile
Re: LOV with more than one child value issue [message #643118 is a reply to message #643116] Tue, 29 September 2015 09:48 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Is there any reason why you can't simply make the initial LOV show enough data to allow users to choose straight away?
What is the relationship between the LOV contents and the items in the datablock?
When the user picks data from the second LOV does it populate an additional item in the record? Or something else?
Re: LOV with more than one child value issue [message #643120 is a reply to message #643118] Tue, 29 September 2015 10:11 Go to previous message
teagemini
Messages: 5
Registered: November 2014
Location: Nova Scotia
Junior Member
There isn't a way that I can make the LOV show one return of data right away. I have other options that the user can use as well but it's just this one that can return more than one row of data.

The user just wants to put in a client number on the application, then choose whether it's a fitness club (or one of another 5 options), then they want the address of the fitness club that they picked to populate a letter in Oracle Reports. As both fitness club records are active, I can't code it so that it only returns one option.





Previous Topic: old windows xp fourms is not open in windows 7 unother pc
Next Topic: Communication form Serial / Parallel port via Oracle Forms
Goto Forum:
  


Current Time: Fri Mar 29 03:27:05 CDT 2024