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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms: How to auto-query base block without relation

Status
Not open for further replies.

Mockenrue

Programmer
May 15, 2002
40
NL

I have a rather straightforward version 4.5 form with two base table blocks, say
block A (single row) and block B (multi row).

No relation exists between the blocks. What I want is when having queried a row
of block A, the rows of block B must be queried automatically, and focus must
remain on block A.

I tried defining a POST-QUERY trigger on block A that would do a GO_BLOCK to
B and perform an EXECUTE_QUERY, but POST-QUERY does not allow restricted
built-ins (like GO_BLOCK).

Any suggestions ?
 
Try to move your code to WHEN-NEW-RECORD-INSTANCE trigger of A. POST-QUERY fires once-per-fetch, so will not fire when navigating to the already fetched record. For the sake of efficiency you may check whether the record is really "NEW", i.e. the condition on B was changed. Of course, the best place for this code is ON-POPULATE-DETAILS trigger, but unfortunately it doesn't fire when no conditions are declared. Once upon a time I created a form with dummy block based on DUAL table, created meaningless relation between blocks and rewrote OPD to refresh data in appropriate blocks. You may choose the best from above for your specific task.

Regards, Dima
 
I seem to recall that you can put a dummy relationship between the blocks to force forms to do this for you. By relationship code being something like:
Code:
   BLKA.COLUMN1 =  BLKB.COLUMN1 
or BLKA.COLUMN1 != BLKB.COLUMN1
Hope that works, it would be easier than trying to force the auto-query yourself.


Code:
select * from Life where Brain is not null
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
When posting code, please use TGML for readability. Thanks!
 

Thanks for your suggestions.

I've tried Dima's approach combined with a library variable and that seems to suit
most of the cases.

I'll see whether BJCooper's relation can be established without post-gen.

Thanks again,
Arthur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top