How to default a value in a query

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

How to default a value in a query

Post by BobK »

When executing a query that uses (Ask at run-time) is it possible to default the value so that the user does not need to enter it?

Specifically, if the query is searching a data field and the majority of the time the date being searched for is the current date, I would like the date field on the query to contain the current date and the user just has to hit "Search". But I also want the user to be able to enter a different date if needed.
Bob
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to default a value in a query

Post by Jaymer »

Is that date the only field that prompts for a value?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: How to default a value in a query

Post by BobK »

No. There are multiple fields prompting for a value but not all of them require a default value.

I just choose the date field as an example and because for dates, the default will change daily.
Bob
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to default a value in a query

Post by Jaymer »

ahh,
can't help with a direct answer to your Q then.

was going to make sure you knew about new-ish input fields in the query header, using global vars (the NP session fields), and the new-ish "same panel" output option. But if you have too many fields then it may not all fit above in Top panel toolbar (or may be too diff than what the user is used to)
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: How to default a value in a query

Post by BobK »

Thanks Jaymer, I will take a look at the new-ish fields and options you mentioned.
Bob
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: How to default a value in a query

Post by ACDC »

When executing a query that uses (Ask at run-time) is it possible to default the value so that the user does not need to enter it?
Instead of "Ask at Run Time" option, create an Input Object dedicated for the query containing the relevant attributes with initial settings and rules
Then in your process create the Object (Enter NEW) and Display the query
with attributes of the query Object=InputObject
Object

So every time the query is run an InputObject is created for the purpose of the query

I use this method for all my date range queries and it works like a dream.
Post Reply