Event/trigger to move from a tabular record to another?

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
  

Poston Wed, 15 Feb 2017 8:07 am

Good day guys need to do a validation of periods in a tabular block where a record with a given period do not overlap one another already registered, I'vê managed to do it by looking at the records saved in the Bank already, it worked okay, but ... If the user insert multiple records in the tabular block before saving, they are not yet in the comic, and I can't do that validation of records that are just on the block and have not yet been saved.

I think you make a loop on the block is not the most appropriate, because I have thousands of records on the block and, besides losing the focus of the current record.

the question is: is it possible to force the forms save a record when I change his focus, for when I go to insert another all of the above are already saved in BD?

PS: I'vê tried WHEN-NEW-RECORD-INSTANCE but it didn't work because it raises in the new record being created and not the previous record that just lost focus.
Porva
Location: São Paulo/SP

Rafael S. Nunes
São Paulo/SP

Poston Wed, 15 Feb 2017 10:58 am

There is the command POST, which does exactly the same thing as the Commit, but it does not commit: * He sends all modified data to the Bank.
* If you need to insert, it does the inserts * if you need to change or delete data, it does everything.
* LESS the COMMIT.

That is, if you make a POST, can do query in the database without any problem.
dr_gori
Location: Seattle, WA, USA

Thomas F. G
https://www.patreon.com/glufke

Poston Wed, 15 Feb 2017 2:08 pm

Hmm, looks like it worked! o/really the POST writes in the Bank but not comitta and if I close the form without saving, it does an automatic rollback! :P put the POST on the trigger WHEN-NEW-RECORD-INSTANCE, so every new record created the forms already saves automatically inserts making validation on the Bank possible.

I'm testing here but it seems that it is working thank you very much for the tip.
Porva
Location: São Paulo/SP

Rafael S. Nunes
São Paulo/SP

Poston Wed, 15 Feb 2017 2:13 pm

The code was so only: on trigger WHEN-NEW-RECORD-INSTANCE of the block:
Code: Select all
IF :SYSTEM.BLOCK_STATUS = 'CHANGED' THEN              
  POST;
END IF;
Porva
Location: São Paulo/SP

Rafael S. Nunes
São Paulo/SP



Return to Forms

Who is online

Users browsing this forum: Google [Bot] and 3 guests