Home » Developer & Programmer » Forms » dirty record--need to be able to query (forms 10g)
dirty record--need to be able to query [message #413447] Wed, 15 July 2009 15:09 Go to next message
tuckersuz
Messages: 26
Registered: July 2009
Junior Member
Hello:

I have an input date that is using the following:
SELECT TRUNC(SYSDATE)
INTO :block.INPUT_DATE FROM DUAL;


This is a required field, and the next field is a required field. If someone wants to query based on this input date, they cannot, because it will move to the next field,and state that input is required. Another developer mentioned creating either a control item, or forcing the field into query mode when started. How do I allow a user to query on this input date if the date is filled, and the user wants to query records based on this input date?

thanks
Re: dirty record--need to be able to query [message #413517 is a reply to message #413447] Thu, 16 July 2009 04:09 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
How are users entering search criteria. They should be doing it in enter-query mode in which case required properties don't apply. So I'm not sure why you have an issue.
Re: dirty record--need to be able to query [message #413587 is a reply to message #413447] Thu, 16 July 2009 09:50 Go to previous messageGo to next message
tuckersuz
Messages: 26
Registered: July 2009
Junior Member
Many thanks for the response. Apologies for any confusion.
The user queries using a query key in a toolbar (when-button-pressed,DO_KEY('Enter_query').

The first item is the input_date, and is a no_entry, no_update field that is populated with trunc(sysdate): (see below)

SELECT TRUNC(SYSDATE)
INTO :block.INPUT_DATE FROM DUAL;

This same input_date field is set to required-yes, and automatic skip-yes. When the form is run, this first item is populated automatically. If I click the Query button, the cursor moves automatically to the next field, which also is a required field, and states FRM-40202: Field must be entered, meaning this next required field must be entered. It will not let me query on the input date. After the query button is pressed, rather than being able to query on the input_date, the cursor automatically moves to the next field instead.
Someone here mentioned that I should use a pre-insert, set the database item to a control item, or force the field into query mode when started.

Any ideas/help would be appreciated.

thanks

Re: dirty record--need to be able to query [message #413588 is a reply to message #413447] Thu, 16 July 2009 09:55 Go to previous messageGo to next message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do the users ever enter this form and start inserting new data or is a query always going to be the first thing they want to do?

And this:
SELECT TRUNC(SYSDATE)
INTO :block.INPUT_DATE FROM DUAL;

Can just be this:
:block.INPUT_DATE := trunc(sysdate);


Don't query dual if you don't need to.
Re: dirty record--need to be able to query [message #413626 is a reply to message #413447] Thu, 16 July 2009 15:49 Go to previous messageGo to next message
tuckersuz
Messages: 26
Registered: July 2009
Junior Member
Hello:

Good point. The user will be entering data, but if the user has an input date, they may want to query on that date alone. If someone can explain how a pre-insert, set the database item to a control item would help, or forcing the field to query mode when started.

thanks
Re: dirty record--need to be able to query [message #413631 is a reply to message #413447] Thu, 16 July 2009 17:07 Go to previous message
cookiemonster
Messages: 12403
Registered: September 2008
Location: Rainy Manchester
Senior Member
Personally I'd just not assign this date as the first thing the form does. Leave it until you know the user is trying to create new records rather than perform query - So you could put that assignment in the pre-insert trigger.
If you start creating a new record in a form before the user has a chance to do anything - which is what you are doing - then it becomes very awkward for them to do something else.
Previous Topic: Assign Long raw value to image field
Next Topic: problem with go_record
Goto Forum:
  


Current Time: Sat Dec 03 22:22:37 CST 2016

Total time taken to generate the page: 0.08968 seconds