Form in Query Mode

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Post Reply
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

Good afternoon guys, I'm resuming my activities in forms and I have the following doubt:

I created a holiday registration screen, and on this screen I created a query button calling a LOV and loading the fields On the same registration screen, but when I carry the fields and try to change the form tries to create another record.

How do I leave the form in query mode to when the LOV loads the fields on the registration screen, and with this I make the registry change.

Thank you very much.
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

I did not quite understand the flow.
It seems that the form is already entering consultation mode.

The query button you created has only one show_lov?
put more information so we can better understand what is happening.
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

Forms is not in consultation mode, I need to do this.

Yes on the button that calls LOV only has the show_lov

I need it when clicked on the button that calls Lov, the forms upload the information for editing .
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Well, when the forms are in Query_Mode, the user must enter information in the fields that will be the filters for the query.
Then he clicks the execute_query and ready.

From there, it is in editing mode of the returned lines.
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

I did the way I said and worked out, following below how the code was.

Select all

EXECUTE_QUERY; 
 
DECLARE 
	VA_SHOW_LOV BOOLEAN; 
BEGIN 
VA_SHOW_LOV := SHOW_LOV('LOV_FERIADO',320,100);
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

There was a part of the code:

Select all

 
EXECUTE_QUERY; 
 
DECLARE 
	VA_SHOW_LOV BOOLEAN; 
BEGIN 
	VA_SHOW_LOV := SHOW_LOV('LOV_FERIADO',320,100); 
END; 
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

Good morning, I made a document exemplifying what I need.

follows attached.
Attachments
FORM.pdf
Exemplo
(690.04 KiB) Downloaded 527 times
davidcastilholi
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 47
Joined: Thu, 07 Apr 2011 3:54 pm
Location: Jussara PR
David

Can someone help me...
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Then:

How a block works:
The block has all features to edit, consult, include rows in a table. (Normally, there is a key that does this.)
When you run the execute_query, it searches for the table, and brings pro block.
If you change these lines, and give a commit, it saves in the table.
No matter how many lines you have changed. It is smart enough to change all lines scrambled.

If you include a new line in this block, it is smart enough to include it. The same if you delete a line. You can delete several and then save.

Then this type of programming with a "confirm" button, "Includes", "Deletes", etc.
This is more on HTML Web Screens, where each action is individual. (And each action shoots a different program).

A block is much better than that.
You do not need to have any code to have all Create, Update, Delete operations.
The only program would be the LOV button, with a show_lov and nothing else.

If necessary even have this type of button, that's fine. But the only thing inside it will be the Commit command, another to erase the line, etc.

All this code you posted that is on the Confirm button, the ideal is that it is in the pre_insert.
Then he goes to DT_CADASTRO: = sysdate for each line, and not just for that.

This trigger will be fired automatically when you give the Commit.
In summary, you do not need any of this.

The validation of IF mark is null, can be at the Trigger When-Validate-Record.
That way, you will not be able to get out of the line without having validated it.

What I would do:
I would take all those buttons on the screen and put a multi-record block, which is much easier to understand.
later, I was going to create a Trigger When-validate-record with the due consistencies.
and a pre-insert trigger with fields that must be populated automatically.

Only!
User avatar
dr_gori
Moderador
Moderador
Posts: 5024
Joined: Mon, 03 May 2004 3:08 pm
Location: Portland, OR USA
Contact:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Here I made a very simple form, which does the following:
* Lets consult, include and change in a multi-record block.
* Search for the description of the Department in Lov.

was not used *** none *** programming. The only line of code is a show_lov that is on the BUTTON_PRESED trigger from the LOV button. (This button is optional, since it is possible to call LOV with the F9 key).

To create the EMP and Dept table, I used this script: https://apexplained.wordpress.com/2013/ ... in-oracle/
Some considerations:
* The source of the block is a query! She seeks the description of the DNAME field.
exemplo_lov.zip
(11.9 KiB) Downloaded 470 times
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests