Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Usage of Prompts

Status
Not open for further replies.

khobar

IS-IT--Management
Sep 24, 2002
38
IN
Hi

I have a prompt department name which has the list

MECH
ELECT
ELECT
COMP

There are three cases in the above for selecting the records from the dept table

1. The user can select only one department MECH in that case only the records related to MECH are displayed.

2. The user can select multiple departments say MECH, COMP in that case the records related to both the DEPT are displayed

For the above two cases we are using the prompt with type inlist so that multiselection is taken care

But I have third case where the user will not select any department from the prompt but directly runs in that case
all the records from the entire dept table will be shown.

But when i use prompts it will not allow me to run until i select atleast one value from the list. How do i address this. (I don't want to select all the values from the prompt as i have a requirment where i may have 100records in the dropdown list of the prompt eventhough in this example i have shown only 4 values )

regards
khobar



 
The following shows how to do this.

I got it from:


Is there any way to set up a prompt that will allow a user to select one value, many values, or type 'ALL' for all values in a list?

Yes. Below is a sample of the syntax required to allow a user to select one, many, or all values from a prompt.

Code:
(@Select(Sales Geography\Country Group) IN @Prompt('Select Country Group or 
enter * for all groups','a','Sales Geography\Country Group',multi,free) ) OR 
('*' in @Prompt('Select Country Group or enter * for all groups','a','Sales 
Geography\Country Group',multi,free))

In the sample, the asterisk is used as the wildcard. The first part of the formula...

Code:
(@Select(Sales Geography\Country) IN @Prompt('Select Country or 
enter * for all countries','a','Sales Geography\Country',multi,free) )


works when a user picks one or more values from the list. The second part...

Code:
OR 
('*' in @Prompt('Select Country or enter * for all countries','a','Sales 
Geography\Country',multi,free))


works when the user selects the asterisk.

If a user selects 'USA', the following statement results...

COUNTRY IN 'USA' OR 'USA' IN '*'

If the user selects the asterisk, the following statement results...

COUNTRY IN '*' OR '*' IN '*'

The IN, combined with 'multi' are the keys to allowing the selection of multiple values from the list. Steve Krandel
BASE Consulting Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top