Field goes null when button press oracle forms? - oracle

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

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.

Related

Form WHERE clause

I have an APEX form I'm developing for "user settings". I have a table with a sequence as a primary key and the users ID in another column...in addition to a few columns where each users saved settings are stored (things like "N" for do not receive notices).
I haven't used Oracle APEX in a while so excuse this likely newbie question...The insert works fine, but I'm having trouble with making the form only show the current users values. In my Form Region the source is set to my Table, and I have a WHERE clause like this:
USER_ID = 813309
But that's not working (813309 is my id and I'm just hard-coding it for now). The form always comes up with a "New" record.
For a form to load a specific record you can set the primary key page item to the value you need. You can do so in the url using the link builder from another page or you can set a computation on the item. That is what I would try in your case: add a computation to your item P_USER_ID of type "Static Value" with value 813309. Make sure the computation happens before the "Fetch Row" - the value obviously needs to be set before the process runs.
In such cases, I prefer creating a Report + Form combination (using the Wizard, of course): it creates an interactive report (so that you can review data in a table), and a form which is used to add new records or update/delete existing ones.
Doing so, when you pick a user in interactive report and click the icon at the beginning of a row, Apex redirects you to the form page, passing primary key column value to the form which then fetches appropriate data from the table.
Not that it won't work the way you're trying to do it, it's just simpler if you let Apex do everything for you.
So: did you create an automatic row fetch pre-rendering process? If not, do so because - without it - Apex doesn't know what to fetch. Also, if you hardcoded user_id, it won't do much good. Consider storing username into the table so that you could reference it via :APP_USER Apex variable.

Validation of Data in datasheet mode--access 2007

Users are PASTING data into a form in DATASHEET mode, so many records are being entered at the same time. For a specific field called ID, I need to validate the ID against another table. In the sense that the IDs they enter should be already available in another table. Drop down box, selection is not possible.
I also need to return the values that are not VALID
What kind of SQL statment or VBA or validation rule should I use?
"In the sense that the IDs they enter should be already available in another table" - you need an event to trigger the check, so perhaps have them enter into a datasheet on a form rather than a back end table then you can use the various on-changed events, search online for them. In that event simply run a one-to-one query. To return "return the values that are not VALID" you simply need an unmatched query, again, search for info, it's widely documented.

Using Oracle Forms(4.5) do_key commit_form fires which trigger and where is its code?

What tool is used to view the Key Triggers? Is it the Oracle Terminal for Windows?
do_key('commit_form'); fires which trigger and where?
(we do not have all the tools and we want to convert, the DB is not even restored at this point) but I am assigned to figure it out. :)
We do not have even a .res (resource) file, and I am guessing this is used for mapping form fields to database columns?
do_key('commit_form'); would fire the KEY-COMMIT trigger, if there is one. If there isn't one, it will just do the default action of that trigger, which is a commit.
Any key triggers would be in the form itself, most likely at the form level, and you would view the triggers using Oracle's Forms Builder.
The form field to database column mapping is also within the form. The block properties will indicate which table or view, and the field properties will tell you which column. In my experience, the fields and the columns usually have the same name, although that is not strictly necessary.

Other way to speed up Microsoft Access Form Load with Datasource

I am tasked to fix a performance issue on a Microsoft Access Form. The page has a datasource using a Query. The Query joins several tables and does summation. The problem is when the page loads, the form uses a dummy value like QueryColumn = 'ImplossibleValue' to show an empty.list. The form contains search condition filter plus search button. When the search button is click the correct Filter is set.
Because the query handles a lot of data, the page loads very slow at first but when the form opens the user is presented with blank query as design. Is there a way to Open the form and to make it have no data source?
You can change the recordsource to a query which returns Null values and need not reference any of your tables.
SELECT Null AS field1, Null AS field2;
After the user selects her search criteria, change the recordsource to the query which incorporates those criteria. Changing the recordsource automatically triggers a requery.
If a user saves the form design after the recordsource has been changed to the search query, the form will use that again the next time it is opened. You can force the form to always open with the dummy row query as its recordsource by resetting that property during the form open event.
Me.RecordSource = "SELECT Null AS field1, Null AS field2;"
When you open the form, use a where condition in the docmd.openform statement. where primarykey = null there will be no records and you don't need to unbind the entire form.
I had similar performance problems with Jet 10 years ago, and the only resolution I found was to move to Access Data Projects.
Upsize to client-server application using SQL Server, run a couple of query wizards to determine proper indexing, and you'll have excellent performance in no time.

Oracle Forms: Problem with master/detail commit

greetings,I'm facing a problem in Oracle Forms 10g. I created a simple master-detail form where i want to save data only from the detail data block (the master will function more as a browser).
The only solution found till now is to edit the properties of text items in the master block and prevent them from inserting/updating. This comes in conflict with the list of values (LOV) appearing when the user tries to input the app_id, or from a search button (i know that the way is not significant). Is there a way that i can pass values to the primary block and function only as a query?
Any help could save me from lots of trouble!
We can set various properties at the block level using the Block Properties palette. In your case you need to toggle off Delete Allowed, Insert Allowed and Update Allowed. Obviously you will want Query Allowed toggled on.

Resources