Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple form query

Status
Not open for further replies.

scomfort

Programmer
Dec 3, 2003
44
GB
Hi there,

I have two questions regarding forms 9i.
1. With multiple forms how do you access what has just been entered in the previous form. For mine I have several forms to go through but Im unsure as to how to obtain what I just entered. In the initial screen the primary key is assigned sequentially; this is then saved along with other information. The next screen I would like to save further information but assigning it to that primary key which was just given.

2. I'm having a problem with the sequential primary key. I have a sequence and the trigger which work fine for one table. However there is another second table which uses this primary key too as its own (primary foreign if you will). If I leave the data fields for this table blank it saves the first tables information fine and sequence works. However if I put anything in the second table I get an integrity constraint error saying the parent key cannot be found. I have set up the master-detail relationship in Forms between the two tables so Im unsure as to what to do now?

Any help would be appreciated!
 
As far as question #1 is concerned, setup a parameter list containing the required items, then pass the parameter list to the next form. Forms help provide decent exanples of this technique.

If I understand #2 correctly, it sounds like your child table is being saved before your parent table. Are your blocks in the form in heirarchical order?

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Thanks for the help BJCooperIT. I'll have a look at the parameter list technique as sounds like what I need to do.
As for the second one it was in order; I deleted the sequence and created it again (exactly the same) and now it works fine. No idea! By the way where is the best place to put the trigger that generates the primary key in Forms?
Oh and since you have the knowledge and I do not :), how do you go about creating a separate window? Essentially I'd have liked to add my own help text directly into a LOV window but this doesnt seem possible (or at least beyond me). So I thought I'd just create a window next to it with help text in it which is called up every time the LOV is - just not sure on how to call and close the window (thought about using an alert but you cant position it can you?).
Cheers.
 
Of course there are different ways to handle this, but I create a new canvas (HELP_CANVAS) and a new modal window (HELP_WINDOW) to use as a pop-up. I place the help text on the canvas along with a button (positioned at bottom center) to close the window. If I need to do that for more than one set of help text, I create multiple help canvases and reuse the same window. I then display the context-based help canvas based on the user selecting help from the menu or pressing the help function key.

The problem in calling this every time the LOV is shown, is that the user has to close the help pop-up before continuing. That could be very annoying. If your help text is not too lengthy could you use the auto hint property for the item?

Perhaps you could try putting the HELP_CANVAS in a non-modal window. You could display it when the LOV is selected by using SHOW_VIEW in the KEY-LISTVAL. Then you would need the HIDE_VIEW in the appropriate trigger (sorry not sure which trigger that is in your case).

I know of no way to specify X and Y coordinates on an alert.

Hope this helps!

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Yes that helped a lot thanks. I just created another canvas and it opens up alongside the LOV which is what I want. To hide it using the hide_view works too but like you said getting it done automatically is another thing. Since the LOV populates a text field could a trigger not be used to hide the view every time the text field changes(I think thats what you suggested above)? I've looked at a fair few of the triggers although not sure which one to use for this case. If there isnt one then I'll have to go along with manually closing the view although I agree, not a very good interface!
 
You could HIDE_VIEW at the end of the the WHEN-VALIDATE-ITEM trigger, however the pop-up would have to be manually closed if the user doesn't select or re-key a value.

Sorry, I do not have access to Forms right now to play with it in order to give you a better suggestion.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
I've managed to get the help canvas to automatically close every time the LOV window closes by putting the show and hide views for the help canvas either side of the show view for the LOV (I used a when-button-pressed trigger and show_LOV to display the LOV rather than the key-listval trigger).
Thanks again for your help - cleared a few things up :)
 
You are welcome.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top