.FLYINGHEAD FORMS DEVELOPMENT
.TITLE Rapidly developing PalmPilot applications
.FEATURE
.SUMMARY Have you ever wanted to build your own PalmPilot application? But perhaps you’re not a programmer, or perhaps you just don’t have the time to build a complex C or C++ application. There is a product called Satellite Forms available that lets you build PalmPilot applications by designing on-screen forms. In this article, Jay Cohan, one of the program’s creators takes us on a step-by-step guided tour of how to create a simple application.
.AUTHOR Jay Cohan
This article introduces some basics of PalmPilot forms development and show you how to quickly get started creating PalmPilot applications using Satellite Forms. Even if you are not a serious programmer, you can quickly build your own custom PalmPilot solutions.
.H1 Building an Application
By the time you read this, or shortly thereafter, Satellite Forms Trial Edition version 2.0 will be available as a free download from the SoftMagic web site, http://www.softmagic.com. The Trial Edition is an excellent tool for familiarizing yourself with PalmPilot application development, prototyping PalmPilot solutions, and laying the groundwork for full-scale deployments without traditional programming.
The remainder of this article outlines how to quickly create a Satellite Forms application, using a sales order application an example. We begin by thinking about the data required by this application and constructing data tables. Based on these tables, we build screens that make up the application’s user-interface, and use actions and filters to increase its navigation and data manipulation capabilities. We then enhance the application with business logic through the scripting language. Finally, we discuss connectivity to corporate databases. Figure A illustrates this process.
.FIGPAIR A The iterative development process provides many opportunities to solicit user feedback.
.H1 Working with Relational Databases
Like many application development tools, Satellite Forms stores data in relational database tables. End-users view and manipulate this data through a graphical user interface (GUI) consisting of a set of forms and controls. If you have experience using Microsoft Access, Oracle, Visual Basic, dBase, or other database programs, you can apply this knowledge directly to Satellite Forms. If you haven’t ever worked with relational databases before, don’t worry. The concepts are not difficult. Skimming the introductory chapter of a book at your local bookstore should do the trick.
Briefly, relational databases store data in objects called tables. Each table contains a specific set of data (e.g., Customers or Orders or Line Items). Tables manage data in rows and columns, similar to spreadsheets. The Orders table might contain columns for Order Number, Order Date, and Purchase Order Number. Each row, or record, of the Orders table contains information about an individual order.
Certain columns relate information from one table to another. For example, the Orders table tracks the customer who placed an order. Rather than store the customer name directly in the Orders table, we store a reference (called a foreign key) to the corresponding record of the Customers table. Doing this saves space because references are typically numbers rather than long names. It also adds flexibility. When information changes (e.g., the customer name changes), it is updated in a single place (the Customers table), and all Orders automatically reflect the updated information.
.H1 Planning an Application
Good application design begins by understanding the problem you are trying to solve and the different pieces of information associated with the problem. You don’t have to know everything right away. Iterative feedback loops give you the opportunity to modify your solution. As you think about your application, ask yourself a few questions:
.BEGIN_LIST
.BULLET What functions will my application accomplish?
.BULLET What pieces of information are important in my application?
.BULLET How are these pieces of information related to each other?
.END_LIST
The sample sales order application helps a sales team take orders in the field. Rather than using paper order forms, reps capture orders directly on their PalmPilots, and synchronize this information with the corporate database. This application tracks three significant pieces of information: Customers, Orders, and Line Items. These become tables.
Each table stores different pieces of information. The Customers table tracks the customer number, name, address, and credit limit. These become columns. Similarly, the Orders table tracks the order number, order date, purchase order number, and whether or not it is a rush order. The Line Items table tracks the product ordered, the quantity, and the price.
As discussed earlier, each order references the customer who placed the order. Thus, the Orders table contains a foreign key column referencing the Customers table. Similarly, the Line Items table contains a foreign key to the Orders table.
Now that we have an outline of our application, we can begin building our prototype.
.H1 Creating tables in Satellite Forms
Creating tables is straightforward. Begin by starting the Satellite Forms App Designer and then select New from the File menu to create a new application, shown in Figure B.
.FIGPAIR B The App Designer manages the application development process.
To start the table editor, select Insert Table from the Edit menu, and then select the New or Edit button to bring up the column editor, shown in Figure C. The column editor lets you specify a column’s name, data type, and size. Specifying the correct data type helps ensure accurate data entry, preventing, for example, end-users from typing characters in a numeric field.
.FIGPAIR C The column editor defines database columns.
Use the column editor to create two numeric columns, ORD_NO and CUST_NO, a character column, PO_NO, a date column, DATE, and a true/false column, RUSH. Figure D shows the completed table. The Editor tab lets you enter sample data for testing. At this point, you can also create the Line Items and Customers tables.
.FIGPAIR D The layout view of the table editor displays the completed Orders table.
.H1 Creating PalmPilot screens
End-users interact with PalmPilot applications through one or more forms, each containing GUI controls. Satellite Forms supports standard controls, including edit fields, drop lists, check boxes, and buttons. It also supports PalmPilot-specific controls like the title bar and Graffiti shift indicator, and special controls like ink fields, bitmaps, and timestamps. Forms and controls can link directly to tables and columns, or can be unbound (not linked), and populated through scripts.
Double-click on Form 1 in the Contents of Application window. A blank form appears and the control palette becomes active on the tool bar. Double-click on the form to edit its properties, shown in Figure E. Form properties determine an end-user’s ability to enter, edit, and delete data.
.FIGPAIR E Form properties specify the linked table and user permissions.
Name this form Orders and link it to the Orders table. Add controls by selecting them from the toolbar. You might add a title control, some edit and text controls, a check box, a drop list, and a time/date stamp. Each control has properties that manage its behavior and link it to underlying data. Link some controls to the columns of the Orders table. The drop list control is particularly interesting, and its properties are shown in Figure F. The drop list is dynamic, drawing data from the Customers table, rather than from a static list. It also manages the foreign key relationship between Orders and Customers, displaying customer name, but storing customer number in the Orders table.
.FIGPAIR F The drop list retrieves data from the Customers table and manages the foreign key relationship with the Orders table.
The simple Orders form is shown in Figure G.
.FIGPAIR G The Orders form incorporates several different types of controls.
.H1 Adding navigation and data manipulation with actions
Many applications consist of multiple forms, and users need the ability to navigate among them. Select Insert Form from the Edit menu to create a second form. This form, Line Items, is shown in Figure H.
.FIGPAIR H The Line Items form lets users enter the order details
It is linked to the Line Items table and lets users enter the products, prices, and quantities associated with an order. The unbound control, Total, will be calculated later. To enable users to navigate between the forms, add a button to the Orders form and edit its properties, setting "Action when Clicked" to jump to the Line Items form, as shown in Figure I.
.FIGPAIR I Actions simplify form and record navigation.
In addition to form navigation, actions can perform record navigation (go to first, next, previous, last record) and data manipulation (create, delete record), launch other applications, and run scripts.
.H1 Managing data presentation with filters
Often, you may need to manage the data seen by the user. For example, a user who jumps from the Orders form to the Line Items form, should only see line items on the current order, and only add line items to the current order. To include this master/detail functionality, add a filter to the button that performs the jump.
Filters separate data based on specific criteria, limiting the records of a table to those that match the criteria. Figure J illustrates setting a filter on the Line Items table to a dynamic criterion, the current order number from the Orders form. This creates the master/detail relationship. Filters can also be used to initialize records with default values, build linked drop lists, and tailor different data to different users.
.FIGPAIR J Filters manage the master/detail relationship between Orders form and Line Items by linking on column ORD_NO.
.H1 Adding business logic with scripts
With actions and filters, we added a lot of functionality without any programming. Now you can use event-driven scripting to incorporate business logic and complex validation in the application. For example, add an order total calculation to the Line Items form. Select Scripts from the View menu and add an AfterChange event, as shown in Figure K. This way, if either the price or quantity changes, the total will be updated. Scripts use syntax similar to Visual Basic:
Total = Price * Qty
.FIGPAIR K Event-driven scripts enhance the form with business logic.
In addition to mathematical and logical operations, the scripting language supports variables, loops, conditional logic, and access to the properties and methods of Satellite Forms objects. Through scripts you can access data in multiple tables, dynamically adjust control properties, and add sound and animation to enhance an application.
Select Download App & Tables from the PalmPilot menu. Test your application, solicit feedback, and make enhancements until you are satisfied. Figure L shows the completed application.
.FIG L The completed application provides convenient data capture and viewing.
.H1 Connecting to enterprise data
Satellite Forms provides tools to integrate your application with many different databases, and allows users to synchronize in different ways. Depending on an application’s requirements, users may synchronize to their desktops, to a local server, or to a remote server. They might connect directly through a serial cable, via modem, through a local area network, or even via the internet.
Ask yourself how many of your users will concurrently synchronize to the same computer. Users who synchronize to their own PC, or small numbers of users who sporadically connect to the same server won’t experience any difficulty with standard HotSync. Be aware, however, that HotSync serializes multiple simultaneous connections. As the number of concurrent users grows, some connections may time out. To mitigate this problem, you can install a program called Winframe, by Citrix, and run multiple instances of WindowsNT and HotSync at the same time. For true scalability, however, you will want to explore one of the available server synchronization solutions: ASL Connect from Advance Systems (http://www.asl.com) and Scout from Noblestar Systems (http://et.noblestar.com). Both Scout and ASL Connect can synchronize many simultaneous PalmPilot users with data from ODBC databases and Lotus Notes.
For smaller scale deployments that don’t need server synchronization, Satellite Forms includes an ActiveX control that helps you integrate with databases. You write a simple server application in a language that understands ActiveX (e.g., Visual Basic, Microsoft Access, Lotus Approach


