Pendragon Software Corporation
Home News Products Order Support Company

Case Studies

 

 

Pendragon Forms Custom Menus - Search Menus

 

A Search Menu may be a time saving point of entry for handheld users who use forms to look up reference information.

 

A single button tap filters records in a subform to help find exactly what your are looking for in the shortest time possible.  A series of scripts compares values in the text and numeric fields in the Search Menu with stored records and returns only matching records. 

 

For example, a real estate form might have records for all properties currently on the market.  A menu search form could be used to select homes that have a matching zip code, a minimum number of bedrooms, and that are within a specified price range.

Scripting a Search Form

Since a button is used to intiate the subform record selection, a single field will contain several SELECT WHERE statements activated by a CLICK statement.  Once selected, records can be reviewed on the handheld or beamed.

SELECT WHERE scripts can be used for a wider range of tasks in Pendragon Forms 4.0  

  • Records can be selected based on more flexible criteria using a range of values in the expression  (e.g. greater than, startswith)

  • Ad hoc searches can be performed by allowing the handheld user to enter search criteria and basing the SELECT WHERE expression on the value entered.

  • Precise filtering can be easily accomplished with by combining multiple SELECT WHERE statements using ALSO

 

A sample script:


click:

 

if $[bedroom] <> null then
Select "Home Finder" where Field 6 > $[bedroom]
endif
 

also
if $[bathroom] <> null then
Select "Home Finder" where Field 7 > $[bathroom]
endif
 

also
if $[maxprice] <> null then
Select "Home Finder" where Field 8 < $[maxprice]
endif

also
if $[minprice] <> null then
Select "Home Finder" where Field 9 > $[minprice]
endif

also
if $[location] <> null then
Select "Home Finder" where Field 10 startswith $[location]
endif

Review "Home Finder"

 

 

 

For more information

Please see Chapter 21: Creating a Custom Main Menu in the Pendragon Forms Reference Guide (To download the PDF, right-click on the link above and choose Save Target As...)

 

 

 

Note:  Pendragon Forms 4.0 or higher required to create a Custom Main Menu. 

 

 

 

Custom Menu Articles:

Overview

Tutorial: Make a Custom Main Menu

Graphics, Scripting & Options

Making a Search Menu

 

 

Select Where Script Basics:

A select script is constructed like:

 

Select formname where field field-number is expression

 

formname is the name of the subform (and is placed in quotation marks in the script)

field-number is the field in the subform

expression is the criteria for matching records, and can be:

A text string

A numeric value

A value from a field in the search form

A function that takes no arguments (e.g. scandata)

 

An expression can also contain a range:

>  Greater than

<  Less than

=  Equal to

contains  Contains a text string

startswith Starts with a text string

 

 

Scripting Tips:

 

Quotation marks should be placed around the subform name and text strings in the expression.

Field names surrounded by brackets can be used to refer to fields on the search form, but field numbers must be used for the subform field-number.

 

 

 

   

 

 

© 2003-2005 Pendragon Software Corporation.  All rights reserved. Copyright and trademark information.