Rehman Khan
Rehman Khan

Reputation: 45

Field goes null when button press oracle forms?

I am creating form for search data in oracle forms 10g

when user select LOV from non-database field and press search button then non-database field goes null. I want field not null when button press

Upvotes: 0

Views: 792

Answers (1)

Littlefoot
Littlefoot

Reputation: 142743

A screenshot would help; it is unclear where's that non-database field placed. If it is a tabular layout forum, is it placed within all the other fields? Or is it somewhere in a control, non-database block?

Anyway: here's how I'd do that.

First of all, if possible, avoid inventing your own searching algorithm. Forms is very good at doing such things by itself. Shortly:

  • enter query mode
  • enter search criteria (select it from a list of values; why not?)
  • execute query
  • absolutely no additional programming is necessary (apart from the LoV)

If, for some reason, you have to do it "your way":

  • put the non-database LoV field into a separate control block
  • WHEN-BUTTON-PRESSED should
    • use SET_BLOCK_PROPERTY and set database block's DEFAULT_WHERE (or, maybe even better, ONETIME_WHERE) to a selected LoV value
    • navigate to a database block (GO_BLOCK)
    • EXECUTE_QUERY
  • alternatively, WHEN-BUTTON-PRESSED would only EXECUTE_QUERY, but you'd use PRE-QUERY trigger on the database block that sets the searching criteria, for example :database_block.name := :control_block.lov_field;

As of your question:

  • it seems that the LoV field is part of the database block, and it gets cleared once you execute query. See if you can re-fill it using POST-QUERY trigger
  • Or, if it is not, check what the WHEN-BUTTON-PRESSED trigger is doing - maybe it clears it

See of what I wrote helps. If not, please, edit the question (your initial message) and provide additional information which would help us help you.

Upvotes: 0

Related Questions