Programming instructions
81
LESSON 3
Creating a Main Application Page
In this lesson you will enhance the Compass Travel Trip Maintenance application. The 
exercises in this lesson guide you through the following steps:
• Transforming the search facility that you built in the previous lesson into a drill-down 
facility for trip queries
• Creating a Trip Detail page to display complete details of a trip
• Implementing a link from Trip Detail page to the search facility
• Converting the Trip Detail page into the main application page by including buttons 
for navigating to other pages and browsing trip records in the database 
This lesson explains how to do the following tasks:
• Use URLEncodedFormat to safely link the Search Results page to the Trip Detail page.
• Use the DateFormat and DollarFormat functions to properly format date and dollar 
variables.
• Use the MOD function and a query variable to properly alternate the back color of rows 
in the Trip Search Results table.
ColdFusion tags and functions introduced in this lesson
The following table identifies the ColdFusion tags and functions that you use in this 
lesson to enhance the sample ColdFusion application:
Element Type Brief description
IsDefined  Function Evaluates a string value to determine whether it 
represents an existing variable. Returns True if the 
variable is found, False if not found.
DollarFormat  Function Returns a number as a string formatted with two 
decimal places, thousands separator, and dollar 
sign. If the specified number is negative, 
parentheses are used. 
DateFormat Function Returns a formatted date/time value. If no mask is 
specified, DateFormat returns the date value in the 
dd-mmm-yy format. DateFormat supports dates 
that have the U.S. date format. 
URLEncodedFormat Function Converts a text string into a string that can safely be 
used in a URL. 










