I have a block from a table.
I want that I fill the code field with a number, and select the record with these number on their id. I want to use the when-validate-item on the code field, I don’t know how “select” the wanted record on oracle forms. Any idea?
Sorry my english.
This’ll be easier if you have two blocks on your form:
A single-record control block (e.g.
SEARCH_BLK) with the code field (e.g.CODE) that will act as a “search” field, as well as a “Search” button.A second block based on your database table (e.g.
MYTABLE) which will show the record. Add a predicate for the block’s DEFAULT_WHERE property, e.g.ID = :SEARCH_BLK.CODE.Your when-button-pressed trigger on your Search button would then have something like:
Note that you can’t call the GO_BLOCK builtin from a when-validate-item trigger.
If you really want to have it done from when-validate-item, you can use the timer trick, described here: GO_BLOCK in WHEN_VALIDATE Trigger