<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>StudioWorks - Quick Start Tutorial</title> <meta name="keywords" content="omnis studio, raining data, studioworks documentation" /> <link rel="stylesheet" type="text/css" href="http://www.studiotips.net/css/codedoc.css" /> <link rel="stylesheet" type="text/css" href="http://www.studioworks-dev.net/css/codedoc.css" /> </head> <body> <div id="container"> <p><a href = ../index.html > Sw4 </a> &nbsp &gt; &nbsp <a href = index.html > About </a> &nbsp &gt; &nbsp Quick Start Tutorial</p> <a name="quickstarttutorial" /> <h2>Quick Start Tutorial</h2> <p>This section covers the steps to follow for getting started with writing a new application using StudioWorks. This quick start tutorial assumes that you have already installed Omnis Studio v4.x and are familiar with creating libraries, classes, and writing notation in Omnis Studio.</p> <p>If you are not familiar with Omnis Studio read the PDFs that come with Omnis Studio and go through the <em>StudioTips Basics Tutorial</em>.</p> <p>If are not familiar with SQL (Sequential Query Language) read some books on SQL to learn the basics of SQL.</p> <p>The StudioWorks framework will jump start writing new applications in Omnis Studio, but you need to know the basics. (Omnis Studio, writing notation, SQL)</p> <p>Print the StudioTips and StudioWorks <span class="nav">Naming Conventions</span>. Read them. Keep them handy near your desk. Learning, understanding, and using the StudioWorks naming and coding conventions will make it much easier to follow the code in StudioWorks.</p> It is highly recommended that you print this tutorial from the on-line version before attemping to do it. You can check off the steps and add your own notes to your printed copy as go through the tutorial. <a name="settingfileandlibrarynames" /> <h3>Setting File And Library Names</h3> <p>The first step is to set up the files and libraries for your new application.</p> <ol> <li>Download and unzip the lastest <span class="file">StartNewApp</span> zip file from the StudioWorks FTP server.</li> <li>Decide on a 2 or 3 letter lower case acronym for your company name which you will use as a prefix for your library names. e.g. <em>Vencor Software</em> uses the 2 letter acronym <span class="code">vs</span> for prefixing library names. <br /> <br /> The company prefix <span class="code">az</span> will be used in this quick start guide. You can substitute your own company 2 or 3 letter acronym whenever you see <span class="code">az</span> in this quick start tutorial or use <span class="code">az</span> for the tutorial. </li> <li>Decide on a short name for your application.<br /> <br /> The short app name <span class="code">Drivers</span> will be used in this quick start guide. You can substitute your own short app name whenever you see <span class="code">Drivers</span> in this quick start tutorial or use the app name <span class="code">Drivers</span>.</li> <li>Rename the unzipped <span class="file">StartNewApp</span> folder to <span class="file">Drivers</span>. The <span class="file">Drivers</span> folder is referred to as the <span class="file">APP</span> folder. The entire application is enclosed inside the <span class="file">APP</span> folder.</li> <li>Inside the <span class="file">Drivers</span> folder, rename <span class="file">open_myApp</span> to <span class="file">open_Drivers</span></li> <li>Inside the <span class="file">APP/libraries</span> folder, rename <span class="file">myAppMain</span> to <span class="file">azDriversMain</span></li> <li>Inside the <span class="file">APP/libraries/modules</span> folder, rename <span class="file">myAppModule</span> to <span class="file">azDrivers</span></li> <li>Inside the <span class="file">APP/libraries/modules</span> folder, rename <span class="file">mySysAdmin</span> to <span class="file">azSysAdmin</span></li> <li>Inside the <span class="file">APP/libraries/modules</span> folder, <strong>delete</strong> all of the other libraries. They are just demo modules.</li> <li>Inside the <span class="file">APP/data</span> folder, rename <span class="file">myAppData</span> to <span class="file">DriversData</span></li> <li>We have renamed the files, but we also need to change the <span class="code">$defaultname</span> property of each library before we <em>open</em> the Drivers application.</li> <li>Open your developer version of Omnis Studio.</li> <li>Under the <span class="nav">File</span> menu select <span class="nav">Open Libraries...</span> and navigate to the <span class="file">azDriversMain</span> library but do <strong>not</strong> click the <span class="nav">Open</span> button. Select the file but don't open it up yet.</li> <li>Hold down the <kbd>Ctrl/Cmnd</kbd> key and <em>then</em> click the <span class="nav">Open</span> button. This opens the library without running the <span class="code">Startup_Task</span></li> <li><span class="nav">F2 Browser</span> > select the <span class="code">myAppMain</span> library > <span class="nav">F6 Properties</span> > <span class="nav">Default</span> tab. Set the <span class="code">$defaultname</span> property to <kbd>azDriversMain</kbd><br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>With multiple library applications it is important that the library name remain consistent. If you don't set the <span class="code">$defaultname</span> property, the library name will change if the user changes the file name. Not a good thing!</p> </div></li> <li><span class="nav">F2 Browser</span> > select the <span class="code">myAppMain</span> library > click <span class="nav">Close Library</span></li> <li>The <span class="code">Startup_Task</span> in each module doesn't do anything so we can open those modules normally.</li> <li>Under the <span class="nav">File</span> menu select <span class="nav">Open Libraries...</span> and navigate to the <span class="file">azDrivers</span> module and click the <span class="nav">Open</span> button.</li> <li><span class="nav">F2 Browser</span> > select the <span class="code">myAppModule</span> library > <span class="nav">F6 Properties</span> > <span class="nav">Prefs</span> tab. Set the <span class="code">$defaultname</span> property to <kbd>azDrivers</kbd></li> <li><span class="nav">F2 Browser</span> > select the <span class="code">myAppModule</span> library > click <span class="nav">Close Library</span></li> <li>Under the <span class="nav">File</span> menu select <span class="nav">Open Libraries...</span> and navigate to the <span class="file">azSysAdmin</span> module and click the <span class="nav">Open</span> button.</li> <li><span class="nav">F2 Browser</span> > select the <span class="code">mySysAdmin</span> library > <span class="nav">F6 Properties</span> > <span class="nav">Prefs</span> tab. Set the <span class="code">$defaultname</span> property to <kbd>azSysAdmin</kbd></li> <li><span class="nav">F2 Browser</span> > select the <span class="code">mySysAdmin</span> library > click <span class="nav">Close Library</span></li> </ol>You are now ready to officially open the <span class="nav">Drivers</span> application. <a name="openingthedriversapp" /> <h3>Opening the Drivers App</h3> <p>To help you get started with StudioWorks the starter app comes with a prepared Omnis data file which has some tables already created and records inserted.</p> <ol> <li>Open the <span class="file">open_Driver</span> library. This opens the <span class="file">azDriversMain</span> library, which in turn opens all the libraries located in the <span class="file">APP/libraries/modules</span> folder and the libraries at the first level in the <span class="file">APP/studioworks</span> folder. The StudioWorks framework libraries are located inside the <span class="file">studioworks</span> folder.</li> <li>All going well you will get to the <span class="nav">Sign-In</span> window. </li> <li>Enter user name: <kbd>SYS</kbd> and password: <kbd>pass</kbd>. Click the <span class="nav">Sign-In</span> button. </li> <li>All going well the <span class="nav">My App</span> main menu will be installed and the main window will be opened.<br /> <br /> Feel free to click on the various nodes in the main window treelist to view lists, edit records, insert new records, etc. </li> <li><span class="nav">My App</span> menu > <span class="nav">Programmer Menu</span> > <span class="nav">Programmer Workbench</span>. This opens the StudioWorks <span class="nav">Programmer Workbench</span> window. <br /> <br /> The <span class="nav">Programmer Workbench</span> is <em>command central</em> for StudioWorks developers.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/tip.gif" alt="Tip" /><p>Use the shortcut key combination <kbd>Shift+Ctrl/Cmnd+Z</kbd> to open the <span class="nav">Programmer Workbench</span>.</p> </div></li> <li>Select the <span class="nav">String Tables</span> tab > <span class="nav">String Tables _stb Schemas Editor</span> tab</li> <li>Expand <span class="code">azDriversMain</span> node if it isn't already expanded. </li> <li>Select the <span class="code">sMn_stb</span> child node. (Click it twice of the list doesn't refresh)</li> <li>Change the description for the <span class="code">AppName</span> column from <span class="code">My App</span> to <span class="code">Drivers</span>. StudioWorks will now translate <span class="code">AppName</span> to <em>Drivers</em> where ever <span class="code">AppName</span> is used as a string table ID.</li> <li>Tab out of the label field. The main menu title should change from <span class="nav">My App</span> to <span class="nav">Drivers</span>.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/tip.gif" alt="Tip" /><p>If you wish to change an ID, click the yellow edit pencil in the ID column heading. This enables the ID fields in the grid. Click the pencil again to disable the ID column.</p> </div></li> </ol> <a name="addingatable" /> <h3>Adding a Table</h3> <p>The StudioWorks starter app comes with a set of tables and window classes which links contacts to towns/cities, and town/cities to states/provinces and countries.</p> <p>For our <span class="nav">Drivers</span> app we will add a table to store <em>autos</em> which are linked to <em>auto types</em>.</p> <p>We'll start with the parent table, <span class="code">Autotype</span>.</p> <p><strong>Create the schema class</strong></p> <ol> <li><span class="nav"><nav>Programmer Workbench</span></nav> > <span class="nav">SQL Meta-Data</span> tab > right-click on the <span class="code">azDrivers</span> node of the treelist > select <span class="nav">New Schema...</span></li> <li>Enter the name of the new schema, <kbd>sAutotype</kbd>. StudioWorks creates the <span class="code">sAutotype</span> schema for you.</li> <li>Select the <span class="code">sAutotype</span> node in the treelist, and click the <span class="nav">SQL Class Editor</span> tab. <br /> <br /> StudioWorks created the new schema for you with various default values and colulmns which you can now modify. The <span class="nav">Class Name</span>, <span class="nav">Description</span>, and <span class="nav">Server Table Name </span>are properties of the <span class="code">sAutotype</span> schema <em>class</em>. The rest of the fields in the window are <em>meta-data</em>. StudioWorks store the meta-data in the <span class="code">oModuleData</span> object class of each library.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>The power of StudioWorks lies in the meta-data. The fields in the meta-data editor have tooltips which give more information about the field. If you are unsure about a certain meta-data field hover your mouse over the field and read the tooltip.</p> </div></li> <li>Change the <span class="nav">Label (Singular)</span> from <span class="code">Autotype</span> to <kbd>Auto Type</kbd>. Tab to the next field.<br /> <br /> Notice that they <span class="nav">Label (Plural)</span> automatically changed from <span class="code">Autotypes</span> to <span class="code">Auto Types</span>. StudioWorks tries to set the plural value for you automatically.<br /> <br /> The label singular is used for the window title when you are editing a record of that table. The label plural is used for the window title when you are looking at a list of records of that table.</li> <li>Click the <span class="nav">Fetch All</span> checkbox so that it is checked. This tells StudioWorks to fetch all of the active <span class="code">autotype</span> records whenever you view them in a list window.</li> <li>Click the <span class="nav">SQL Columns Editor</span> tab.</li> <li>Right-click on the column names list and select <span class="nav">New Column...</span></li> <li>Enter the column name <kbd>AutoTypeName</kbd>.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/warning.gif" alt="Warning" /><p>You must be very careful to use the correct <em>case</em> for schema class and column names. Omnis Studio is case-sensitive with class names and column names. Naming the schema class <span class="code">sAutotype</span> and then referring to it as <span class="code">sAutoType</span> in another place will not work. Your code will fail if you name a schema column <span class="code">AutoTypeName</span>, but then refer to it as <span class="code">AuotypeName</span> in a calculation.</p> </div></li> <li>Drag the <span class="nav">AutoTypeName</span> column to the 2nd row of the columns list if it isn't already the 2nd row.</li> <li>Set the character length field to 20 characters.</li> <li>Set the <span class="nav">Label</span> to <kbd>Auto Type Name</kbd>. Set the <span class="nav">Abbreviation</span> to <kbd>Auto Type</kbd>.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>StudioWorks will default to use the label value for the abbreviation. Abbreviations are used for headed list column headings, report column headings, and pushbuttons.</p> </div></li> <li>Set the <span class="nav">Unique Index</span> checkbox to checked.</li> <li>Uncheck <span class="nav">Null</span> and <span class="nav">Blank</span> in the <span class="nav">Values Allowed</span> group box.</li> <li>Check <span class="nav">Include in Lists</span>, <span class="nav">Prompts/Lookups</span>, and <span class="nav">Include in Search Columns</span> in the <span class="nav">Lists</span> group box.</li> <li>Set the <span class="nav">Sort Column</span> checkbox to checked.</li> </ol><div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>Entry fields in the meta-data editor with a blue background are default values. If you edit a default value the background will change to white, indicating a non-default value. To revert to a default value, clear the entry field and tab out of the field.</p> </div><p><strong>Create the table in the database</strong></p> <ol> <li>Click the <span class="nav">Database Admin</span> tab in the <span class="nav">Programmer Workbench</span>. The <span class="nav">Database Admin</span> window is where you can sync your database tables to match your application's schemas. It also lets you view data, update primary keys, and a number of other database related functions.</li> <li>Click the <span class="nav">Schemas and Tables</span> tab.</li> <li>Select <span class="code">autotype</span> in the <span class="nav">Schema Table</span> list. </li> <li>Click the <span class="nav">Sync Database to Match Selected Schema</span> button. This creates the new table in the database with the appropriate indexes. An information window will be opened that tells you the SQL script that was executed, actions taking, and if applicable and warnings or errors that were reported during the sync operation. Review the information and close the window.</li> </ol>You now have a table in the database ready to store records. <a name="addingawindow" /> <h3>Adding a Window</h3> <p>Every window instance which you open in your StudioWorks application must first be <em>declared</em>. Each module declares its own window instances.</p> <p>Each window instance must have a unique <span class="code">wininstid</span>. StudioWorks lets you set properties for each window instance.</p> <p>The <span class="nav">Window Instance</span> tab of the <span class="nav">Programmer Workbench</span> is where we can view and declare window instances.</p> <ol> <li>Click the <span class="nav">Window Instances</span> tab in the <span class="nav">Programmer Workbench</span>.</li> <li>Expand the <span class="code">azDrivers</span> node in the treelist.</li> <li>Note the <span class="code">AutotypeEdit</span> and <span class="code">AutotypeList</span> nodes in the treelist. StudioWorks automatically declares an <em>edit</em> and a <em>list</em> window instance for each schema class that you create.</li> <li>Click the <span class="code">AutotypeList</span> node and look at the window instance properties. The fields in the upper portion of the window are display-only because this is a <em>default</em> window instance.</li> <li>Make sure the <span class="code">toolbarvisible</span> and <span class="code">searchbarvisible</span> checkboxes are checked for the <span class="code">AutotypeList</span> window instance.</li> </ol> <a name="testingthewindow" /> <h3>Testing the Window</h3> <p>We are now ready to test opening the <span class="code">AutotypesList</span> window instance.</p> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/tip.gif" alt="Tip" /><p>Omnis Studio seems to cache the list of database tables when working with the Omnis data file. After you add some new tables you might need to <span class="nav">Quit Omnis</span> and reopen the application to force Omnis Studio to rebuild the database tables list. This only applies to the Omnis data file. If in the next few steps or later in the tutorial that you get some SQL errors after you've added a new table to the Omnis data file, try quitting Omnis and reopening the app.</p> </div><ol> <li>With the <span class="code">AutotypeList</span> node selected in the treelist, click the <span class="nav">Open WinInst</span> button at the bottom of the <span class="nav">Programmer Workbench</span> window.</li> <li>Click the <span class="nav">New</span> button in the toolbar. The <span class="code">AutotypeEdit</span> autoconfig window instance should appear.</li> <li>Enter the <span class="nav">Auto Type Name</span> <kbd>Truck</kbd>. Click the <span class="nav">Save and Close</span> button or press the <span class="nav">Return</span> key.</li> <li>Click the <span class="nav">New</span> button in the toolbar.</li> <li>Enter the <span class="nav">Auto Type Name</span> <kbd>Car</kbd>. Click the <span class="nav">Save and Close</span> button.</li> <li>Click the <span class="nav">New</span> button in the toolbar.</li> <li>Enter the <span class="nav">Auto Type Name</span> <kbd>Bus</kbd>. Click the <span class="nav">Save and Close</span> button.</li> </ol>Congratulations you have created a table and inserted some records into the table! Easy, eh?! <a name="mappingicons" /> <h3>Mapping Icons</h3> <p>In StudioWorks you can map an <span class="code">iconid</span> to a <span class="code">wininstid</span> or a <span class="code">basetable</span>. Mapping an <span class="code">iconid</span> to a <span class="code">basetable</span> is more efficient because multiple window instances that use to the same <span class="code">basetable</span> will immediately be mapped to the same <span class="code">iconid</span>.</p> <p>For window instances that do not have a <span class="code">basetable</span> (e.g. container windows), or window instances that you want to map to a different <span class="code">iconid</span>, you can map an <span class="code">iconid</span> to the <span class="code">wininstid</span>.</p> <ol> <li>Click the <span class="nav">Icons List Editor</span> tab in the <span class="nav">Programmer Workbench</span>.</li> <li>Click the <span class="nav">Open Icons Browser</span> button and take a look at the catalogue of StudioWorks icons available to you. The StudioWorks <span class="nav">Icons Browser</span> is a collection of icons in the <span class="code">swIcons4</span> library. Each <span class="code">iconid</span> is mapped to an <em>icon group</em> and an <em>icon name</em>.</li> <li>Enter <kbd>car</kbd> in the search field and click the search button.</li> <li>Right-click on the <span class="code">PaperCar</span> icon and select <span class="nav">Copy Icon Full Name to Clipboard</span>.</li> <li>Close the StudioWorks <span class="nav">Icons Browser</span> window.</li> <li>Select the <span class="code">azDrivers</span> library in the <span class="nav">Icons List Editor</span> droplist.</li> <li>Right-click on the icons list and select <span class="nav">New Icon...</span> </li> <li>Enter <kbd>Autotype</kbd> in the following prompt for input window. Autotype will be added to the icons list.</li> <li>Set the <span class="nav">schemacoldesc</span> field to <kbd>vs.PaperCar</kbd> (You can paste this in from the clipboard). When you tab out of the field, the <span class="code">Autotype</span> icon in the icons list should change to the <em>PaperCar</em> icon.</li> <li>Click the <span class="nav">Window Instances</span> tab in the <span class="nav">Programmer Workbench</span>. The <span class="code">AutotypeEdit</span> and <span class="code">AutotypeList</span> window instances should now be mapped to the <span class="code">$iconid</span> of the <span class="code">vs.PaperCar</span> icon name.</li> <li>Go back to the <span class="nav">Icons List Editor</span> and select the <span class="code">azDriversMain</span> library in the droplist.</li> <li>Change the <span class="nav">schemacoldesc</span> to <kbd>vs.Truck</kbd> and tab out of the field.</li> <li>Close and reopen the <span class="nav">Main Window</span>. The root node of the navigation treelist should have changed from a <em>cube</em> icon to a <em>truck</em> icon.</li> </ol><div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>When you add an icon node to the <span class="nav">Icons List Editor</span> treelist, you are really adding a new row to the <span class="code">sIcons</span> schema class of the parent node library. The <span class="nav">Icons List Editor</span> is just an interface for editing the <span class="code">sIcons</span> schema classes. The advantage of using the <span class="nav">Icons List Editor</span> is that you immediately see a represention of the icon which you assigned, and the cached lists affected by your changes are immediately updated. (icons master list, windows master list, navigation menus list)</p> </div> <a name="addingawindowtothenavigationlist" /> <h3>Adding a Window to the Navigation List</h3> <p>The <span class="nav">Navigation List Editor</span> is used to add/remove window instances to/from the main window's navigation treelist.</p> <p>Let's add the <span class="nav">AutotypesList</span> window instance to the navigation treelist.</p> <ol> <li>Click the <span class="nav">Window Instances</span> tab in the <span class="nav">Programmer Workbench</span>.</li> <li>Click the <span class="nav">Navigation Menus List Editor</span> tab.</li> <li>Expand the <span class="code">Drivers</span> node in the treelist.</li> <li>Right-click the <span class="code">Drivers</span> node and select <span class="code">Add WinInstID...</span></li> <li>Select the <span class="code">azDrivers</span> > <span class="code">AutotypeList</span> node in the prompt window and click the <span class="nav">Continue</span> button.</li> <li>All going well the <span class="code">AutotypeList</span> window instance will be added as a child node to the <span class="code">Drivers</span> root node.</li> <li>You can reorder the navigation list by dragging and dropping node(s) in the treelist.</li> <li>Open the main window (Ctrl/Cmnd+M). Expand the <span class="nav">Drivers</span> root node. All going well the <span class="nav">Auto Types</span> window instance will be appear as a child node.</li> <li>Click on the <span class="nav">Auto Types</span> node. The <span class="code">AutotypeList</span> window instance will appear in a subwindow to the right of the navigation treelist.</li> </ol> <a name="addingachildtable" /> <h3>Adding a Child Table</h3> <p>The steps for creating the <span class="code">Auto</span> table are pretty much the same as the steps for creating the <span class="code">Autotype</span> table.</p> <p><strong>Create the schema class</strong></p> <ol> <li><span class="nav"><nav>Programmer Workbench</span></nav> > <span class="nav">SQL Meta-Data</span> tab > <span class="code">azDrivers</span> > right-click <span class="nav">New Schema...</span>. </li> <li>Name the new schema, <kbd>sAuto</kbd>.</li> <li>Select the <span class="nav">SQL Class Editor</span> tab.</li> <li>The <span class="nav">Label (Singular)</span> and the <span class="nav">Label (Plural)</span> values should already be set for you. If not, set them to <kbd>Auto</kbd> and <kbd>Autos</kbd>.</li> <li>Set the <span class="nav">Fetchall</span> checkbox to checked.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>If the <span class="code">Auto</span> table was going to contain hundreds of records you would <strong>not</strong> check fetchall.</p> </div></li> <li><span class="nav">SQL Columns Editor</span> tab > right-click on the columns list > select <span class="nav">New Column...</span></li> <li>Enter the name: <kbd>AutoName</kbd></li> <li>Set the character length to <kbd>50</kbd>.</li> <li>Drag the <span class="code">AutoName</span> column to the 2nd row in the second row in the columns list.</li> <li>Set the <span class="nav">Label</span> to <kbd>Auto Name</kbd> if it isn't already set for you. Leave the abbreviation as is.</li> <li>Set the <span class="nav">Unique Index</span> checkbox to checked.</li> <li>Uncheck <span class="nav">Null</span> and <span class="nav">Blank</span>.</li> <li>Check <span class="nav">Include in Lists</span>, <span class="nav">Prompts/Lookups</span>, <span class="nav">Include in Search Columns</span>, and <span class="nav">Sort Column</span>.</li> <li>Add another column <span class="code">Autotype_fkey</span>.</li> <li>Drag the <span class="code">Autotype_fkey</span> column to the 3rd row in the columns list.</li> <li>Set the data type to <kbd>Integer</kbd>, and the subtype to <kbd>Long Int</kbd><br /> <br /> This is the <em>foreign key</em> column which is used to link a <em>child</em> <span class="code">Auto</span> record to its <em>parent</em> <span class="code">Autotype</span> record.</li> <li>Set the <span class="nav">Foreign Key</span> checkbox to checked. Based on the column name StudioWorks will find the autotype table and set it as the referenced table, and then find the primary key column in the autotype table and set it to the referenced column name.</li> <li>Set the <span class="nav">Cascade Delete</span> checkbox to <strong>unchecked</strong> if it checked.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/warning.gif" alt="Warning" /><p>If cascade delete is checked, child records are automatically deleted when the parent record is deleted. You want to be very careful with cascade deletes!</p> </div></li> <li>Set the <span class="nav">Null</span>, <span class="nav">Zero</span> and <span class="nav">Negative</span> checkboxes to unchecked in the values allowed group. This enforces every child record to be linked to a parent record. Allowing null or zero values in the foreign key makes the child/parent link optional. </li> <li>Set the <span class="nav">Hidden</span> checkbox to checked if it is unchecked.</li> </ol> <p><strong>Create the table in the database</strong></p> <ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Database Admin</span> tab > <span class="nav">Schemas and Tables</span> tab.</li> <li>Select <span class="code">Auto</span> in the <span class="nav">Schema Table</span> list. </li> <li>Click the <span class="nav">Sync Database to Match Selected Schema</span> button. This creates the new table in the database with the appropriate indexes.</li> </ol> <a name="creatingqueryclasses" /> <h3>Creating Query Classes</h3> <p>We need to create query classes which joins the child <span class="code">Auto</span> records to their parent <span class="code">Autotype</span> records.</p> <p><strong>Create the list view query class</strong></p> <ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Query Builder</span> tab.</li> <li>Expand the <span class="code">azDrivers</span> node in the <span class="nav">Queries</span> treelist on the <strong>left</strong> side of the <span class="nav">Query Builder</span> window.</li> <li>Right-click on the <span class="code">azDrivers</span> node and select <span class="nav">New Query...</span>.</li> <li>Name the new query, <kbd>qAutoList</kbd></li> <li>Expand the <span class="code">azDriver</span> node in the <span class="nav">Schemas</span> treelist on the <strong>right</strong> side of the <span class="nav">Query Builder</span> window.</li> <li>Select the <span class="code">sAuto</span> schema class node.</li> <li>Drag the columns: <span class="code">auto_pkey</span> and <span class="code">AutoName</span> onto the <span class="code">qAutoList</span> query class.</li> <li>Select the <span class="code">sAutotype</span> schema class node.</li> <li>Drag the column: <span class="code">AutoTypeName</span> onto the <span class="code">qAutoList</span> query class.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>Based on the foreign keys meta-data the StudioWorks <span class="nav">Query Builder</span> will make its best guess at calculating the <span class="code">$extraquerytext</span> to join the query class tables as you add or remove query class columns. If the <span class="code">$extraquerytext</span> is not being calculated click the <span class="nav">Rebuild Meta-Data</span> button below the schemas treelist and then click the <span class="nav">Extra Query Text</span> button to recalculate the <span class="code">$extraquerytext</span>.<br /> <br /> Always check, and if needed, correct the <span class="code">$extraquerytext</span> when you have finished changing the columns. You are ultimately responsible for the final <span class="code">$extraquerytext</span>.</p> </div></li> <li>The <span class="nav">Extra Query Text</span> in <span class="nav">Query Builder</span> should read as follows:<br /> <br /> <p class="code">WHERE auto.autotype_fkey = autotype.autotype_pkey</p> <br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/tip.gif" alt="Tip" /><p>The Omnis data file is picky about the order of the foreign key and primary key columns. To help you remember the order think about alphabetic order... <em>fkey</em> comes before <em>pkey</em>.</p> </div></li> </ol> <p><strong>Create the edit view query class</strong></p> <ol> <li>Right-click on the <span class="code">azDrivers</span> node in the <span class="nav">Queries</span> treelist on the <strong>left</strong> side and select <span class="nav">New Query...</span>.</li> <li>Name the new query, <kbd>qAutoEdit</kbd></li> <li>Expand the <span class="code">azDriver</span> node in the <span class="nav">Schemas</span> treelist on the <strong>right</strong> side of the <span class="nav">Query Builder</span> window.</li> <li>Drag and drop the <span class="code">sAuto</span> schema class node on the <span class="nav">Query Columns</span> list. The column name value in the query columns list will be empty. By leaving the column name empty Omnis Studio will automatically include <strong>all</strong> of the columns from <span class="code">sAuto</span> schema class in the query class.</li> <li>Select the <span class="code">sAutotype</span> schema class node.</li> <li>Drag the column: <span class="code">AutoTypeName</span> onto the <span class="code">qAutoList</span> query class.</li> <li>Make sure the <span class="code">$extraquerytext</span> reads as follows: <br /> <br /> <p class="code">WHERE auto.autotype_fkey = autotype.autotype_pkey</p> </li> </ol> <a name="addingthechildwindow" /> <h3>Adding the Child Window</h3> <p>Map an icon to the <span class="code">Auto</span> table adding it to the icons list.</p> <ol> <li>Click the <span class="nav">Icons List Editor</span> tab in the <span class="nav">Programmer Workbench</span>.</li> <li>Select the <span class="code">azDrivers</span> library in the droplist. </li> <li>Right-click on the icons list and select <span class="nav">New Icon...</span> </li> <li>Enter <kbd>Auto</kbd> in the prompt window.</li> <li>Enter <kbd>vs.Car</kbd> in the <span class="nav">schemacoldesc</span> field. When you tab out of the field, the Auto icon should display a car.</li> </ol> <p>Add the <span class="nav">Autos</span> window to the navigation list.</p> <ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Window Instances</span> tab > <span class="nav">Navigation Menus List Editor</span> tab.</li> <li>Expand the <span class="code">Drivers</span> node in the treelist.</li> <li>Right-click the <span class="code">Drivers</span> node and select <span class="code">Add WinInstID...</span></li> <li>Select the <span class="code">azDrivers</span> > <span class="code">AutoList</span> node in the prompt window and click the <span class="nav">Continue</span> button.</li> <li>All going well the <span class="code">AutoList</span> window instance will be added as a child node to the <span class="code">Drivers</span> root node.</li> <li>You can drag the <span class="code">AutoList</span> node to the position you want it to appear in the navigation list.</li> </ol> <p>We are now ready to test opening the <span class="code">AutoList</span> window instance.</p> <ol> <li><span class="nav">Drivers</span> > menu > select <span class="nav">Main Window</span>. <span class="nav">Autos</span> should now appear in the main window navigation treelist as a child of the <span class="nav">Drivers</span> node. </li> <li>Click the <span class="nav">Autos</span> node. The <span class="code">AutosList</span> autoconfig window instance should appear in the main window navigation treelist. If the main window was open you will need to close and reopen it.</li> <li>Click the <span class="nav">New</span> button in the toolbar. The <span class="code">AutoEdit</span> autoconfig window instance should appear.</li> <li>Enter the <span class="nav">Auto Name</span> <kbd>Ford F150</kbd>.</li> <li>Tab to the <span class="nav">Auto Type Name</span> field. The red border on the field indicates that it is a <em>lookup type-ahead</em> entry field.</li> <li>Type a <kbd>?</kbd> character in the field. StudioWorks displays a list of the possible auto types to select from.</li> <li>Hit the <kbd>down</kbd> and <kbd>up</kbd> arrow keys. StudioWorks scrolls the selected line in the droplist.</li> <li>Hit the <kbd>backspace</kbd> key and type the character <kbd>T.</kbd> StudioWorks displays a list of the auto types which begin with the letter T.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>The Omnis data file is case-sensitive, so you must type upper case T for this example. For other databases the lookups are case-insensitive.</p> </div></li> <li>Click the droplist button to the right of the <span class="nav">Auto Type Name</span> field. StudioWorks displays a list of the possible auto types to select from.</li> <li>Click the <kbd>Truck</kbd> auto type in the droplist. StudioWorks closes the droplist and enters <kbd>Truck</kbd> in the entry field.</li> <li>Tab out of the field.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>On <span class="code">evAfter</span> StudioWorks sets the <span class="code">Autotype_fkey</span> column in the <span class="code">qAutoEdit</span> list to the <span class="code">Autotype_pkey</span> of the selected auto type record.</p> </div></li> <li>Click the <span class="nav">Save and Close</span> button.</li> <li>Click the <span class="nav">New</span> button in the toolbar.</li> <li>Enter the <span class="nav">Auto Name</span> <kbd>Jaguar</kbd> and the <span class="nav">Auto Type Name</span> <kbd>Car</kbd>. </li> <li>Click the <span class="nav">Save and Close</span> button.</li> </ol>Congratulations you have created a child table and inserted some child records linked to parent records! <a name="linkingtoanotherparenttable" /> <h3>Linking to Another Parent Table</h3> <p>Try the following assignment on your own.</p> <ol> <li>Add a foreign key column to the <span class="code">sAuto</span> schema to link it to the <span class="code">sContact</span> schema. </li> <li>Set the meta-data. <br /> <br /> You will need to set the <span class="nav">Null</span> allowed and <span class="nav">Zero</span> allowed values to checked so that linking auto records to contacts records will be optional.</li> <li>Sync the <span class="code">sAuto</span> table to the database.<br /> <br /> The <span class="code">contact_fkey</span> column in the <span class="code">Auto</span> table will be empty for the existing records in the <span class="code">Auto</span> table. This will break the joins for those records. To fix this we will need to add a zero primary key record to the <span class="code">contact</span> table and set the <span class="code">contact_fkey</span> to zero for all the columns in the <span class="code">auto</span> table as follows:</li><ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Database Admin</span> tab > <span class="nav">Schemas and Tables</span> tab > select <span class="code">contact</span></li> <li>Click the <span class="nav">Insert Empty Records</span> button. This checks for an empty record and if not found inserts an empty record with the primary key set to zero.</li> <li>Select the <span class="nav">Interactive SQL</span> tab and enter the following SQL statement:<br /> <br /> <span class="code">UPDATE auto SET contact_fkey = 0 WHERE contact_fkey IS NULL</span></li> <li>Click the <span class="nav">Execute SQL</span> button.</li> <li>Click the <span class="nav">Data Viewer</span> tab and select the <span class="code">auto</span> table. Scroll across to the far right column to check the values in the <span class="code">contact_fkey</span> column.</li> </ol> <p> <li> Using <span class="nav">Query Builder</span> modify the <span class="code">qAutoList</span> and <span class="code">qAutoEdit</span> query classes to include the <span class="code">ContactSortName</span> column from <span class="code">sContact</span>.</p> <p>Be sure the <span class="code">$extraquerytext</span> text joins the <span class="code">Auto</span> table to the <span class="code">Contact</span> table.</p> <p> <li> If you are using the Omnis data file you may need to quit Omnis and reopen your application before proceeding.</p> <p> <li> Select the <span class="nav">Autos</span> node in the main window navigation treelist.</p> <p> <li> Edit an existing <span class="code">auto</span> record and link it to a contact.</p> <p> <li> Insert a new <span class="code">auto</span> record linked to an <span class="code">autotype</span> and a <span class="code">contact</span>.<br /> </ol></p> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>The <span class="nav">Contact Sort Name</span> labels can be changed to <span class="nav">Driver Sort Name</span> in the <span class="code">AutoList</span> and <span class="code">AutoEdit</span> window instances by changing the <span class="nav">String Table</span> name in the class meta-data of the <span class="code">qAutoList</span> and <span class="code">qAutoEdit</span> query classes. The quick start tutorial doesn't cover how to do this, but it is good know that you can create different labels for different query classes with the meta-data.</p> </div> <a name="defaultreports" /> <h3>Default Reports</h3> <p>The StudioWorks framework auto-creates a report when you click the <span class="nav">Print</span> button in the list view toolbar. The report includes all of the columns and records data displayed in the list.</p> <p>After you print a report you will find an <span class="code">X_</span> prefixed report class in the same library as the list query class. The report class name is based on the <span class="code">WinInstID</span> of the list view window instance. If you remove the <span class="code">X_</span> prefix from the report class, the StudioWorks framework will continue to use the report class as the default report for that <span class="code">WinInstID</span>. You can then open the default report class, reposition fields, and make as many modifications as you like. Your changes will be evident the next time you click the <span class="nav">Print</span> button in the list view toolbar.</p> See the StudioTips > StudioWorks group > <span class="nav">Reports</span> tab for information on creating custom reports. <a name="exportingdata" /> <h3>Exporting Data</h3> If you click the <span class="nav">Export</span> button in a list view window the StudioWorks framework exports the columns and records data displayed in the list. The records are exported to a tab delimited text file. The column headings are included at the top of the file. <a name="addingmenus" /> <h3>Adding Menus</h3> <p>You can add menus to any window instance. The menus appear in the toolbar.</p> <p>To add a <span class="nav">Special</span> menu to the <span class="code">AutoList</span> window instance:</p> <ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Window Instances</span> tab > <span class="nav">Window Menus List Editor</span> tab.</li> <li>Expand the <span class="code">azDrivers</span> library node.</li> <li>Right-click on the <span class="code">AutoList</span> node and select <span class="nav">Add Special Menu...</span></li> <li>Enter <kbd>ExportAutoTables</kbd> as the <span class="code">menulineid</span> in the prompt.<br /> <br /> All going well a <span class="code">Special</span> menu child node will be added to the <span class="code">Autos</span> node with the menu line, <span class="code">Export Auto Tables</span>, added as a child node of the <span class="code">Special</span> menu.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>When you add a menu line or change the <span class="nav">menulineid</span>, StudioWorks automatically adds the <span class="code">menulineid</span> the <span class="code">sMn_stb</span> schema class in that library and updates the string tables. You can further edit the string table text in the <span class="nav">String Tables _stb Schemas Editor</span>.<br /> <br /> StudioWorks adds a <em>recipient</em> method with the same name as the <span class="code">menulineid</span> to the observer object class specified for the menu line. If the <span class="code">menuid</span> is <span class="code">Reports</span>, then a recipient method is also added to the <span class="code">oPrintReport</span> object in the same library.<br /> <br /> You can click the edit pencil next to the menuclassname to go to the specified menu class. You can click the edit pencil next to the observer objectclassname to go to th observer object method that is called by this menu item.</p> </div></li> <li>Click the <span class="code">Export Auto Tables</span> node if it isn't already selected. The default values for the menu line are displayed in the fields to the right of the treelist. You can change the menu line's properties by editing these fields.</li> <li>Close and reopen the <span class="nav">Main Window</span> and select the <span class="nav">Autos</span> node.</li> <li>Click the <span class="nav">Special</span> menu in the far right side of the toolbar and select <span class="nav">Export Autos Table</span>. <br /> <br /> All going well you will end up at the breakpoint of the <span class="code">$ExportAutoTable</span> method of the <span class="code">oSpecialMenuObserver</span> object. You would write your code in this method to fetch all the records from the auto table and export them to a file.</li> </ol> <p>To add a <span class="nav">Reports</span> menu to the <span class="code">AutoList</span> window instance:</p> <ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Window Instances</span> tab > <span class="nav">Window Menus List Editor</span> tab.</li> <li>Expand the <span class="code">azDrivers</span> library node.</li> <li>Right-click on the <span class="code">AutoList</span> node and select <span class="nav">Add Reports Menu...</span></li> <li>Enter <kbd>AutosReportSortByType</kbd> as the <span class="code">menulineid</span> in the prompt.<br /> <br /> All going well a <span class="code">Reports</span> menu child node will be added to the <span class="code">Autos</span> node, with the <span class="nav">Autos Report Sort By Type</span> menu line as a child node of the <span class="code">Reports</span> menu.<br /> <br /> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>The StudioWorks framework will add the object classes <span class="code">oReportsMenuObserver</span> and <span class="code">oPrintReport</span> to a module if they don't exist when the first report menu item has been declared. <br /> <br /> The <span class="code">oReportsMenuObserver</span> is classified as a <em>visual</em> object class. If you need to prompt the user to enter/select criteria before printing the report, do the prompts from this <em>visual</em> menu observer object. <br /> <br /> The <span class="code">oPrintReport</span> object is classified as a <em>non-visual</em> object which means you should never prompt the user or open any error prompt windows in the <span class="code">oPrintReport</span> object class methods. <br /> <br /> By splitting apart the visual code which prompts the user, from the non-visual print report code, you will be able to reuse the non-visual <span class="code">oPrintReport</span> code when you add a web interface to your StudioWorks app. Trust me, it is worth doing. Clearly separating visual class code from non-visual make for cleaner reuseable code.</p> </div></li> <li>Close and reopen the <span class="nav">Main Window</span> and select the <span class="nav">Autos</span> node.</li> <li>Click the <span class="nav">Reports</span> menu in the right side of the toolbar and select <span class="nav">Autos Report Sort By Type</span>. <br /> <br /> All going well you will end up at the breakpoint of the <span class="code">$AutosReportSortByType</span> method of <span class="code">oReportsMenuObserver</span>. You would write your code to prompt the user for the auto types they wish to include in the report and then pass this via parameters to the non-visual <span class="code">$AutosReportSortByType</span> method of <span class="code">oPrintReport</span> object.<br /> <br /> For prompting the user, use the <span class="code">oPromptModeless</span> object which is instantiated by the task variable <span class="code">modelessprmpt</span>. For more information see StudioTips > StudioWorks group > <span class="nav">Prompts</span> tab.<br /> <br /> For reports that do not require any user prompts you can remove the breakpoint and simply forward the message from the <span class="code">oReportsMenuObserver</span> object to the <span class="code">oPrintReport</span> object.</li> </ol><div class="image_sideline"><img src="http://www.studiotips.net/css/images/note.gif" alt="Note" /><p>You can associate an icon with any menu line by mapping an icon to the <span class="code">menulineid</span> in the <span class="nav">Icons List Editor</span>.</p> </div> <a name="customizingawindow" /> <h3>Customizing a Window</h3> <p>The objective of the StudioWorks framework is to allow quickly move from database design to a basic application that allows you (and your client) to insert and link records, view lists and print simple reports.</p> <p>If you are converting an existing application you can import data from the old application and then play around with viewing and massaging the imported data in the new application.</p> <p>Once you get through the database design and generating the basic application you will be into the phase of creating custom windows with added bells and whistles to make data entry and modification easier for the users.</p> <p>To create a concrete window class from an autoconfig window class:</p> <ol> <li><span class="nav">Programmer Workbench</span> > <span class="nav">Window Instances</span> tab > <span class="nav">Window Instances Editor</span> tab</li> <li>Select the <span class="code">AutoEdit</span> node.</li> <li>Click the <span class="nav">Developerize</span> button.<br /> <br /> The StudioWorks framework creates a <span class="code">wAutoEdit</span> window class in the <span class="code">azDrivers</span> module. In StudioWorks we call this a <em>developerized</em> window class. In object-oriented programming terms it is a <em>concrete</em> window class.</li> <li>Click the <span class="nav">Modify</span> button. This opens the <span class="code">wAutoEdit</span> window class in the IDE.</li> <li>Rearrange the fields on the window and add a pushbutton object from the <span class="nav">F3 Component Store</span>.</li> <li>Close the <span class="code">wAutoEdit</span> window class.</li> <li>Click the <span class="nav">Open WinInstID</span> button to open an instance of the <span class="code">wAutoEdit</span> window class.<br /> <br /> Your changes to the <span class="code">wAutoEdit</span> window class should be evident in the edit window instance.</li> </ol> <p>Using normal Omnis Studio code you can customize your window class by adding field event methods, window objects, etc. to your concrete window class.</p> <p>The following sample code is from the <span class="code">$event</span> method of the <span class="code">ContactFormalName</span> entry field of the <span class="code">wContactEdit</span> window class.</p> <p class="code">On evBefore<br /> If len($cobj.$contents)=0<br /> &nbsp;&nbsp;&nbsp;If iList.isHousehold<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate SortName as iList.ContactSortName<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If pos(',',SortName)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate FirstName as trim(mid(SortName,pos(',',SortName)+1))<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate LastName as trim(mid(SortName,1,pos(',',SortName)-1))<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate [$cobj.$dataname] as con(FirstName,' ',LastName)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate [$cobj.$dataname] as iList.ContactSortName<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br /> &nbsp;&nbsp;&nbsp;Else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Calculate [$cobj.$dataname] as iList.ContactSortName<br /> &nbsp;&nbsp;&nbsp;End If<br /> &nbsp;&nbsp;&nbsp;Do $cobj.$redraw()<br /> End If<br /> Quit event handler (Pass to next handler)</p> <p>The code copies the <span class="code">ContactSortName</span> to the <span class="code">ContactFormalName</span> if the <span class="code">ContactFormalName</span> is empty. For households the last name and first name are flipped from the <span class="code">ContactSortName</span> to the <span class="code">ContactFormalName</span>.</p> <div class="image_sideline"><img src="http://www.studiotips.net/css/images/tip.gif" alt="Tip" /><p>It is important to end your <span class="code">$event</span> method code with <span class="code">Quit event handler (Pass to next handler)</span> so that the StudioWorks framework's field handler can properly decorate the field on <span class="code">evBefore</span> and <span class="code">evAfter</span>.</p> </div> <a name="summary" /> <h3>Summary</h3> <p>Hopefully this quick start tutorial has given you a sense of how the StudioWorks framework can assist you with rapid application development.</p> <p>We have really only scratched the surface in this tutorial. It is extremely difficult to write a tutorial that satisfies the wants and needs of all developers. Some developers like to have incredible detail, others get bored with too much detail.</p> <p>The real learning happens when you write your own application and have to deliver it to a client.</p> <p>Don't try to get too fancy too soon. Follow the pattern of the quick start tutorial by focusing on the database design, meta-data, and auto-generated window instances. Don't get side tracked into building custom window classes too early on. Get some real data into the database and generate some reports before tackling custom window classes.</p> <p>The farther you can get with using meta-data and auto-generated windows the better off you are.</p> <p>As you start adding custom features and enhancement to your StudioWorks app you will need to search the StudioWorks documentation, look at the methods and code inside the classes, and ask questions on the StudioWorks members list.</p> <p>The real learning is about to begin. Omnis Studio, StudioWorks, and SQL are a powerful combination - but you'll need to roll up your sleeves and be very persistent in order to learn how to harness the power.</p> <p>The StudioWorks members are a great community of developers, but they can't write your application for you (at least not for free). You can ask the questions, but you have to be persistent with the learning.</p> <p>There may be days you question your decision to invest in StudioWorks, but trust me, there are several man years of code included in the framework and many more years of experience that have been invested into learning Omnis Studio and object-oriented programming techniques. There are tools and features included in the StudioWorks framework which are the combined efforts of several StudioWorks devlopers. You would spend years writing (and debugging) these tools and features on your own.</p> <p>Working together we all win!</p> <p>Happy coding,</p> Doug Kuyvenhoven<br /> <a href="http://www.vencor.ca">Vencor Software</a> <a name="whatnext" /> <h3>What Next?</h3> <p>The following is a recommended list of things to do as you move forward with developing your new StudioWorks application.</p> <ol> <li>If you haven't already done so, print the StudioTips and StudioWorks <span class="nav">Naming Conventions</span>. Read them. Keep them handy near your desk. Learning, understanding, and using the StudioWorks naming and coding conventions will make it much easier to follow the code in StudioWorks.</li> <li>If you are new to SQL or don't have formal database design training order a copy of <span class="nav">Database Design for Mere Mortals</span> by Micheal Hernandez from amazon.com. Read the book. I wish I read this book before writing my first app. Much of the thinking behind the <span class="nav">SQL Meta-Data Editor</span> came from reading this book.</li> <li>If you are new to SQL order a copy of <span class="nav">Mastering SQL</span> by Martin Gruber from amazon.com. I recommend this as a reference book for figuring out SQL scripts. You can do amazing things with SQL. With a little bit of SQL knowledge you can eliminate tons of list processing code in your application, and improve performance for compiling reports, etc. Spend time investing in learning advanced SQL, it is worth it.</li> <li>Learn to use Omnis Studio. To use StudioWorks you need to be familiar with Omnis Studio. If you aren't familiar with using Omnis Studio, you will be lost if when you try to write code in StudioWorks. Take the time to read the Omnis Studio PDFs and go through the tutorials and exercises they provide you with.</li> <li>Read through StudioTips to increase your knowledge of Omnis Studio.</li> <li>Do all of the StudioTips Tutorials. The tutorials help you understand StudioWorks.</li> <li>Learn Omnis Studio notation. Omnis Studio notation is powerful and StudioWorks uses Omnis Studio notation extensively. You can accomplish almost anything in Omnis Studio using notation. The notation becomes very logical once you begin to understand the syntax. There is no quick start tutorial to learning Omnis Studio notation. You can learn a lot by taking the time to study the comments and notation in the StudioWorks code.</li> <li>Learn to use the <span class="nav">F4 Notation Inspector</span> along with the <span class="nav">F6 Property Manager</span> to see the methods and properties. These two tools are the heart of where I figure out how to write Omnis Studio notation.</li> <li>Learn to use the <span class="nav">Interface Manager</span>. The <span class="nav">Interface Manager</span> shows the class methods you can call in an instance of class. <em>Sending messages</em> between instances of classes is a big part of Object-Oriented Programming. The <span class="nav">Interface Manager</span> reveals to you the messages you can send.</li> <li>Learn Object-Oriented Programming. Order a copy of <span class="nav">Building Object Applications That Work</span> by Scott Ambler from amazon.com, and read the book. Learning Object-Oriented Programming is a process that takes years. I'm still learning. The StudioWorks framework comes with loads of prewritten, well commented, reuseable, Object-Oriented Programming code. This gives you the advantage of live examples which you can learn from.</li> <li>Order a copy of <span class="nav">Code Complete</span> by Steve McConnell from amazon.com and read the book. This is one of the best books on writing good code. Loads of great advice. Much of the StudioWorks naming conventions are based on the recommendations in this book.</li> <li>Attend the StudioWorks <em>training camps</em> when they are held. There is nothing like in-class training. In a few days you will advance months in your application development.</li> <li>Attend Omnis conferences when they are held.</li> </ol> <p>The above list might seem daunting. If it was easy, anybody could write custom software solutions. Once you gain the above knowledge and experience you can use Omnis Studio and StudioWorks to create powerful, flexible, and maintainable custom applications in an incredibly short period of time.</p> The next tutorial, <span class="nav">Customizing Your App</span>, takes you through adding custom features and code to the meta-data based auto-generated <span class="nav">Drivers</span> app that you wrote in the <span class="nav">Quick Start Tutorial</span>. <p class="footer">StudioWorks Documentation - Copyright 2005 Vencor Software </p></div> </body> </html>