[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4089
  • Last Modified:

How to refresh Oracle Form

I have an Oracle 6i form. Its part pf a larger 6i MDI app. When it loads for first time it comes up blank and in query mode which is fine. When I query and text boxes fill with data they are still there when I exit and come back in. This is unwanted. I want the exit button to clear the form so that when the form gets called up again it is blank.
Is there a built-in function that does this? Or do I have to manually clear all text boxes, drop downs etc...?
0
claghorn
Asked:
claghorn
  • 3
  • 3
  • 2
2 Solutions
 
MilleniumaireCommented:
The default behaviour of forms when a form is first started is NOT to display any data.  To automatically query the data you would need to specifically add code to perform a query on form startup.  The fact that you say you "exit" the form and the data is still there when you re-enter it suggests that code has been written to automatically query data when the form is started, however, this code must be conditionally called to avoid it querying the data the first time the form is loaded.

It may be that the form is setting a global variable or a forms parameter to save the value of a field and to the use that variable/parameter to perform an auto query when it starts up.  Global variables and parameters can persist across invokations of a form within a session and so they can store values between calls.  You will need to examine the PRE-FORM trigger and/or the WHEN-NEW-FORM-INSTANCE trigger to determine if code exists here to perform the auto query.
0
 
jwahlCommented:
depending on your application logic there may be triggers that avoid requery when calling the form again. or on exit your form only gets "unvisible" and pops up with data. or ... or ... or ...

there are built-ins CLEAR_FORM and CLEAR BLOCK you may use. but be careful if you don't understand the application logic!
0
 
claghornAuthor Commented:
There was a post-form trigger that set two globals to the last search id's that were set during a query and were then used upon re-entry into the form. I have cancelled the setting of these variables. Now the form comes up blank and in query mode which is desired. One last thing is to trap the F7 Key event and clear any remaining items that may have been set. Can you tell me how to trap the F7 Key?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jwahlCommented:
F7 enters the query mode. you can check this with :SYSTEM.FORM_STATUS = 'QUERY'
0
 
MilleniumaireCommented:
Does the F7 key put the form into enter query mode as suggested by jwahl?  (On our system the keys have been redefined so I can't remember what the default mappings are).

What do you mean by "clear any remaining items that may have been set".
0
 
claghornAuthor Commented:
I tried to trap the event in the form level KEY-EXEQRY trigger. Its traps it alright but when its added as a trigger, the F7 key no longer works as it used to. I guess the trigger over-rides the default functionality.
I would use your suggestion of :SYSTEM.FORM_STATUS = 'QUERY' but where would I put it?
I just want to set the property of a couple display items to hidden when the user hits the F7 key.
0
 
jwahlCommented:
entries in the KEY-ENTQRY overwrite the default function. so you have to do it manually, e.g.

(KEY-ENTQRY):

BEGIN
    ENTER_QUERY;
    SET_ITEM_PROPERTY('ITEM_NAME1', ENABLED, PROPERTY_FALSE);
    SET_ITEM_PROPERTY('ITEM_NAME2', ENABLED, PROPERTY_FALSE);
    ...
END;
   
0
 
claghornAuthor Commented:
OK, that works. Thank You. It works with the code arranged like this:
BEGIN
    SET_ITEM_PROPERTY('ITEM_NAME1', ENABLED, PROPERTY_FALSE);
    SET_ITEM_PROPERTY('ITEM_NAME2', ENABLED, PROPERTY_FALSE);
    ENTER_QUERY;
END;
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now