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.
If you are not familiar with Omnis Studio read the PDFs that come with Omnis Studio and go through the StudioTips Basics Tutorial.
If are not familiar with SQL (Sequential Query Language) read some books on SQL to learn the basics of SQL.
The StudioWorks framework will jump start writing new applications in Omnis Studio, but you need to know the basics. (Omnis Studio, writing notation, SQL)
Print the StudioTips and StudioWorks Naming Conventions. 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.
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.
Setting File And Library Names
The first step is to set up the files and libraries for your new application.
Download and unzip the lastest StartNewApp zip file from the StudioWorks FTP server.
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. Vencor Software uses the 2 letter acronym vs for prefixing library names.
The company prefix az will be used in this quick start guide. You can substitute your own company 2 or 3 letter acronym whenever you see az in this quick start tutorial or use az for the tutorial.
Decide on a short name for your application.
The short app name Drivers will be used in this quick start guide. You can substitute your own short app name whenever you see Drivers in this quick start tutorial or use the app name Drivers.
Rename the unzipped StartNewApp folder to Drivers. The Drivers folder is referred to as the APP folder. The entire application is enclosed inside the APP folder.
Inside the Drivers folder, rename open_myApp to open_Drivers
Inside the APP/libraries folder, rename myAppMain to azDriversMain
Inside the APP/libraries/modules folder, rename myAppModule to azDrivers
Inside the APP/libraries/modules folder, rename mySysAdmin to azSysAdmin
Inside the APP/libraries/modules folder, delete all of the other libraries. They are just demo modules.
Inside the APP/data folder, rename myAppData to DriversData
We have renamed the files, but we also need to change the $defaultname property of each library before we open the Drivers application.
Open your developer version of Omnis Studio.
Under the File menu select Open Libraries... and navigate to the azDriversMain library but do not click the Open button. Select the file but don't open it up yet.
Hold down the Ctrl/Cmnd key and then click the Open button. This opens the library without running the Startup_Task
F2 Browser > select the myAppMain library > F6 Properties > Default tab. Set the $defaultname property to azDriversMain
With multiple library applications it is important that the library name remain consistent. If you don't set the $defaultname property, the library name will change if the user changes the file name. Not a good thing!
F2 Browser > select the myAppMain library > click Close Library
The Startup_Task in each module doesn't do anything so we can open those modules normally.
Under the File menu select Open Libraries... and navigate to the azDrivers module and click the Open button.
F2 Browser > select the myAppModule library > F6 Properties > Prefs tab. Set the $defaultname property to azDrivers
F2 Browser > select the myAppModule library > click Close Library
Under the File menu select Open Libraries... and navigate to the azSysAdmin module and click the Open button.
F2 Browser > select the mySysAdmin library > F6 Properties > Prefs tab. Set the $defaultname property to azSysAdmin
F2 Browser > select the mySysAdmin library > click Close Library
You are now ready to officially open the Drivers application.
Opening the Drivers App
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.
Open the open_Driver library. This opens the azDriversMain library, which in turn opens all the libraries located in the APP/libraries/modules folder and the libraries at the first level in the APP/studioworks folder. The StudioWorks framework libraries are located inside the studioworks folder.
All going well you will get to the Sign-In window.
Enter user name: SYS and password: pass. Click the Sign-In button.
All going well the My App main menu will be installed and the main window will be opened.
Feel free to click on the various nodes in the main window treelist to view lists, edit records, insert new records, etc.
My App menu > Programmer Menu > Programmer Workbench. This opens the StudioWorks Programmer Workbench window.
The Programmer Workbench is command central for StudioWorks developers.
Use the shortcut key combination Shift+Ctrl/Cmnd+Z to open the Programmer Workbench.
Expand azDriversMain node if it isn't already expanded.
Select the sMn_stb child node. (Click it twice of the list doesn't refresh)
Change the description for the AppName column from My App to Drivers. StudioWorks will now translate AppName to Drivers where ever AppName is used as a string table ID.
Tab out of the label field. The main menu title should change from My App to Drivers.
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.
Adding a Table
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.
For our Drivers app we will add a table to store autos which are linked to auto types.
We'll start with the parent table, Autotype.
Create the schema class
> SQL Meta-Data tab > right-click on the azDrivers node of the treelist > select New Schema...
Enter the name of the new schema, sAutotype. StudioWorks creates the sAutotype schema for you.
Select the sAutotype node in the treelist, and click the SQL Class Editor tab.
StudioWorks created the new schema for you with various default values and colulmns which you can now modify. The Class Name, Description, and Server Table Name are properties of the sAutotype schema class. The rest of the fields in the window are meta-data. StudioWorks store the meta-data in the oModuleData object class of each library.
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.
Change the Label (Singular) from Autotype to Auto Type. Tab to the next field.
Notice that they Label (Plural) automatically changed from Autotypes to Auto Types. StudioWorks tries to set the plural value for you automatically.
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.
Click the Fetch All checkbox so that it is checked. This tells StudioWorks to fetch all of the active autotype records whenever you view them in a list window.
Click the SQL Columns Editor tab.
Right-click on the column names list and select New Column...
Enter the column name AutoTypeName.
You must be very careful to use the correct case for schema class and column names. Omnis Studio is case-sensitive with class names and column names. Naming the schema class sAutotype and then referring to it as sAutoType in another place will not work. Your code will fail if you name a schema column AutoTypeName, but then refer to it as AuotypeName in a calculation.
Drag the AutoTypeName column to the 2nd row of the columns list if it isn't already the 2nd row.
Set the character length field to 20 characters.
Set the Label to Auto Type Name. Set the Abbreviation to Auto Type.
StudioWorks will default to use the label value for the abbreviation. Abbreviations are used for headed list column headings, report column headings, and pushbuttons.
Set the Unique Index checkbox to checked.
Uncheck Null and Blank in the Values Allowed group box.
Check Include in Lists, Prompts/Lookups, and Include in Search Columns in the Lists group box.
Set the Sort Column checkbox to checked.
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.
Create the table in the database
Click the Database Admin tab in the Programmer Workbench. The Database Admin 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.
Click the Schemas and Tables tab.
Select autotype in the Schema Table list.
Click the Sync Database to Match Selected Schema 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.
You now have a table in the database ready to store records.
Adding a Window
Every window instance which you open in your StudioWorks application must first be declared. Each module declares its own window instances.
Each window instance must have a unique wininstid. StudioWorks lets you set properties for each window instance.
The Window Instance tab of the Programmer Workbench is where we can view and declare window instances.
Click the Window Instances tab in the Programmer Workbench.
Expand the azDrivers node in the treelist.
Note the AutotypeEdit and AutotypeList nodes in the treelist. StudioWorks automatically declares an edit and a list window instance for each schema class that you create.
Click the AutotypeList node and look at the window instance properties. The fields in the upper portion of the window are display-only because this is a default window instance.
Make sure the toolbarvisible and searchbarvisible checkboxes are checked for the AutotypeList window instance.
Testing the Window
We are now ready to test opening the AutotypesList window instance.
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 Quit Omnis 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.
With the AutotypeList node selected in the treelist, click the Open WinInst button at the bottom of the Programmer Workbench window.
Click the New button in the toolbar. The AutotypeEdit autoconfig window instance should appear.
Enter the Auto Type NameTruck. Click the Save and Close button or press the Return key.
Click the New button in the toolbar.
Enter the Auto Type NameCar. Click the Save and Close button.
Click the New button in the toolbar.
Enter the Auto Type NameBus. Click the Save and Close button.
Congratulations you have created a table and inserted some records into the table! Easy, eh?!
Mapping Icons
In StudioWorks you can map an iconid to a wininstid or a basetable. Mapping an iconid to a basetable is more efficient because multiple window instances that use to the same basetable will immediately be mapped to the same iconid.
For window instances that do not have a basetable (e.g. container windows), or window instances that you want to map to a different iconid, you can map an iconid to the wininstid.
Click the Icons List Editor tab in the Programmer Workbench.
Click the Open Icons Browser button and take a look at the catalogue of StudioWorks icons available to you. The StudioWorks Icons Browser is a collection of icons in the swIcons4 library. Each iconid is mapped to an icon group and an icon name.
Enter car in the search field and click the search button.
Right-click on the PaperCar icon and select Copy Icon Full Name to Clipboard.
Close the StudioWorks Icons Browser window.
Select the azDrivers library in the Icons List Editor droplist.
Right-click on the icons list and select New Icon...
Enter Autotype in the following prompt for input window. Autotype will be added to the icons list.
Set the schemacoldesc field to vs.PaperCar (You can paste this in from the clipboard). When you tab out of the field, the Autotype icon in the icons list should change to the PaperCar icon.
Click the Window Instances tab in the Programmer Workbench. The AutotypeEdit and AutotypeList window instances should now be mapped to the $iconid of the vs.PaperCar icon name.
Go back to the Icons List Editor and select the azDriversMain library in the droplist.
Change the schemacoldesc to vs.Truck and tab out of the field.
Close and reopen the Main Window. The root node of the navigation treelist should have changed from a cube icon to a truck icon.
When you add an icon node to the Icons List Editor treelist, you are really adding a new row to the sIcons schema class of the parent node library. The Icons List Editor is just an interface for editing the sIcons schema classes. The advantage of using the Icons List Editor 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)
Adding a Window to the Navigation List
The Navigation List Editor is used to add/remove window instances to/from the main window's navigation treelist.
Let's add the AutotypesList window instance to the navigation treelist.
Click the Window Instances tab in the Programmer Workbench.
Click the Navigation Menus List Editor tab.
Expand the Drivers node in the treelist.
Right-click the Drivers node and select Add WinInstID...
Select the azDrivers > AutotypeList node in the prompt window and click the Continue button.
All going well the AutotypeList window instance will be added as a child node to the Drivers root node.
You can reorder the navigation list by dragging and dropping node(s) in the treelist.
Open the main window (Ctrl/Cmnd+M). Expand the Drivers root node. All going well the Auto Types window instance will be appear as a child node.
Click on the Auto Types node. The AutotypeList window instance will appear in a subwindow to the right of the navigation treelist.
Adding a Child Table
The steps for creating the Auto table are pretty much the same as the steps for creating the Autotype table.
Create the schema class
> SQL Meta-Data tab > azDrivers > right-click New Schema....
Name the new schema, sAuto.
Select the SQL Class Editor tab.
The Label (Singular) and the Label (Plural) values should already be set for you. If not, set them to Auto and Autos.
Set the Fetchall checkbox to checked.
If the Auto table was going to contain hundreds of records you would not check fetchall.
SQL Columns Editor tab > right-click on the columns list > select New Column...
Enter the name: AutoName
Set the character length to 50.
Drag the AutoName column to the 2nd row in the second row in the columns list.
Set the Label to Auto Name if it isn't already set for you. Leave the abbreviation as is.
Set the Unique Index checkbox to checked.
Uncheck Null and Blank.
Check Include in Lists, Prompts/Lookups, Include in Search Columns, and Sort Column.
Add another column Autotype_fkey.
Drag the Autotype_fkey column to the 3rd row in the columns list.
Set the data type to Integer, and the subtype to Long Int
This is the foreign key column which is used to link a childAuto record to its parentAutotype record.
Set the Foreign Key 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.
Set the Cascade Delete checkbox to unchecked if it checked.
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!
Set the Null, Zero and Negative 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.
Set the Hidden checkbox to checked if it is unchecked.
Click the Sync Database to Match Selected Schema button. This creates the new table in the database with the appropriate indexes.
Creating Query Classes
We need to create query classes which joins the child Auto records to their parent Autotype records.
Create the list view query class
Programmer Workbench > Query Builder tab.
Expand the azDrivers node in the Queries treelist on the left side of the Query Builder window.
Right-click on the azDrivers node and select New Query....
Name the new query, qAutoList
Expand the azDriver node in the Schemas treelist on the right side of the Query Builder window.
Select the sAuto schema class node.
Drag the columns: auto_pkey and AutoName onto the qAutoList query class.
Select the sAutotype schema class node.
Drag the column: AutoTypeName onto the qAutoList query class.
Based on the foreign keys meta-data the StudioWorks Query Builder will make its best guess at calculating the $extraquerytext to join the query class tables as you add or remove query class columns. If the $extraquerytext is not being calculated click the Rebuild Meta-Data button below the schemas treelist and then click the Extra Query Text button to recalculate the $extraquerytext.
Always check, and if needed, correct the $extraquerytext when you have finished changing the columns. You are ultimately responsible for the final $extraquerytext.
The Extra Query Text in Query Builder should read as follows:
WHERE auto.autotype_fkey = autotype.autotype_pkey
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... fkey comes before pkey.
Create the edit view query class
Right-click on the azDrivers node in the Queries treelist on the left side and select New Query....
Name the new query, qAutoEdit
Expand the azDriver node in the Schemas treelist on the right side of the Query Builder window.
Drag and drop the sAuto schema class node on the Query Columns list. The column name value in the query columns list will be empty. By leaving the column name empty Omnis Studio will automatically include all of the columns from sAuto schema class in the query class.
Select the sAutotype schema class node.
Drag the column: AutoTypeName onto the qAutoList query class.
Make sure the $extraquerytext reads as follows:
WHERE auto.autotype_fkey = autotype.autotype_pkey
Adding the Child Window
Map an icon to the Auto table adding it to the icons list.
Click the Icons List Editor tab in the Programmer Workbench.
Select the azDrivers library in the droplist.
Right-click on the icons list and select New Icon...
Enter Auto in the prompt window.
Enter vs.Car in the schemacoldesc field. When you tab out of the field, the Auto icon should display a car.
Right-click the Drivers node and select Add WinInstID...
Select the azDrivers > AutoList node in the prompt window and click the Continue button.
All going well the AutoList window instance will be added as a child node to the Drivers root node.
You can drag the AutoList node to the position you want it to appear in the navigation list.
We are now ready to test opening the AutoList window instance.
Drivers > menu > select Main Window. Autos should now appear in the main window navigation treelist as a child of the Drivers node.
Click the Autos node. The AutosList 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.
Click the New button in the toolbar. The AutoEdit autoconfig window instance should appear.
Enter the Auto NameFord F150.
Tab to the Auto Type Name field. The red border on the field indicates that it is a lookup type-ahead entry field.
Type a ? character in the field. StudioWorks displays a list of the possible auto types to select from.
Hit the down and up arrow keys. StudioWorks scrolls the selected line in the droplist.
Hit the backspace key and type the character T. StudioWorks displays a list of the auto types which begin with the letter T.
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.
Click the droplist button to the right of the Auto Type Name field. StudioWorks displays a list of the possible auto types to select from.
Click the Truck auto type in the droplist. StudioWorks closes the droplist and enters Truck in the entry field.
Tab out of the field.
On evAfter StudioWorks sets the Autotype_fkey column in the qAutoEdit list to the Autotype_pkey of the selected auto type record.
Click the Save and Close button.
Click the New button in the toolbar.
Enter the Auto NameJaguar and the Auto Type NameCar.
Click the Save and Close button.
Congratulations you have created a child table and inserted some child records linked to parent records!
Linking to Another Parent Table
Try the following assignment on your own.
Add a foreign key column to the sAuto schema to link it to the sContact schema.
Set the meta-data.
You will need to set the Null allowed and Zero allowed values to checked so that linking auto records to contacts records will be optional.
Sync the sAuto table to the database.
The contact_fkey column in the Auto table will be empty for the existing records in the Auto table. This will break the joins for those records. To fix this we will need to add a zero primary key record to the contact table and set the contact_fkey to zero for all the columns in the auto table as follows:
Click the Insert Empty Records button. This checks for an empty record and if not found inserts an empty record with the primary key set to zero.
Select the Interactive SQL tab and enter the following SQL statement:
UPDATE auto SET contact_fkey = 0 WHERE contact_fkey IS NULL
Click the Execute SQL button.
Click the Data Viewer tab and select the auto table. Scroll across to the far right column to check the values in the contact_fkey column.
Using Query Builder modify the qAutoList and qAutoEdit query classes to include the ContactSortName column from sContact.
Be sure the $extraquerytext text joins the Auto table to the Contact table.
If you are using the Omnis data file you may need to quit Omnis and reopen your application before proceeding.
Select the Autos node in the main window navigation treelist.
Edit an existing auto record and link it to a contact.
Insert a new auto record linked to an autotype and a contact.
The Contact Sort Name labels can be changed to Driver Sort Name in the AutoList and AutoEdit window instances by changing the String Table name in the class meta-data of the qAutoList and qAutoEdit 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.
Default Reports
The StudioWorks framework auto-creates a report when you click the Print button in the list view toolbar. The report includes all of the columns and records data displayed in the list.
After you print a report you will find an X_ prefixed report class in the same library as the list query class. The report class name is based on the WinInstID of the list view window instance. If you remove the X_ prefix from the report class, the StudioWorks framework will continue to use the report class as the default report for that WinInstID. 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 Print button in the list view toolbar.
See the StudioTips > StudioWorks group > Reports tab for information on creating custom reports.
Exporting Data
If you click the Export 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.
Adding Menus
You can add menus to any window instance. The menus appear in the toolbar.
To add a Special menu to the AutoList window instance:
Right-click on the AutoList node and select Add Special Menu...
Enter ExportAutoTables as the menulineid in the prompt.
All going well a Special menu child node will be added to the Autos node with the menu line, Export Auto Tables, added as a child node of the Special menu.
When you add a menu line or change the menulineid, StudioWorks automatically adds the menulineid the sMn_stb schema class in that library and updates the string tables. You can further edit the string table text in the String Tables _stb Schemas Editor.
StudioWorks adds a recipient method with the same name as the menulineid to the observer object class specified for the menu line. If the menuid is Reports, then a recipient method is also added to the oPrintReport object in the same library.
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.
Click the Export Auto Tables 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.
Close and reopen the Main Window and select the Autos node.
Click the Special menu in the far right side of the toolbar and select Export Autos Table.
All going well you will end up at the breakpoint of the $ExportAutoTable method of the oSpecialMenuObserver object. You would write your code in this method to fetch all the records from the auto table and export them to a file.
To add a Reports menu to the AutoList window instance:
Right-click on the AutoList node and select Add Reports Menu...
Enter AutosReportSortByType as the menulineid in the prompt.
All going well a Reports menu child node will be added to the Autos node, with the Autos Report Sort By Type menu line as a child node of the Reports menu.
The StudioWorks framework will add the object classes oReportsMenuObserver and oPrintReport to a module if they don't exist when the first report menu item has been declared.
The oReportsMenuObserver is classified as a visual object class. If you need to prompt the user to enter/select criteria before printing the report, do the prompts from this visual menu observer object.
The oPrintReport object is classified as a non-visual object which means you should never prompt the user or open any error prompt windows in the oPrintReport object class methods.
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 oPrintReport 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.
Close and reopen the Main Window and select the Autos node.
Click the Reports menu in the right side of the toolbar and select Autos Report Sort By Type.
All going well you will end up at the breakpoint of the $AutosReportSortByType method of oReportsMenuObserver. 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 $AutosReportSortByType method of oPrintReport object.
For prompting the user, use the oPromptModeless object which is instantiated by the task variable modelessprmpt. For more information see StudioTips > StudioWorks group > Prompts tab.
For reports that do not require any user prompts you can remove the breakpoint and simply forward the message from the oReportsMenuObserver object to the oPrintReport object.
You can associate an icon with any menu line by mapping an icon to the menulineid in the Icons List Editor.
Customizing a Window
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.
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.
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.
To create a concrete window class from an autoconfig window class:
The StudioWorks framework creates a wAutoEdit window class in the azDrivers module. In StudioWorks we call this a developerized window class. In object-oriented programming terms it is a concrete window class.
Click the Modify button. This opens the wAutoEdit window class in the IDE.
Rearrange the fields on the window and add a pushbutton object from the F3 Component Store.
Close the wAutoEdit window class.
Click the Open WinInstID button to open an instance of the wAutoEdit window class.
Your changes to the wAutoEdit window class should be evident in the edit window instance.
Using normal Omnis Studio code you can customize your window class by adding field event methods, window objects, etc. to your concrete window class.
The following sample code is from the $event method of the ContactFormalName entry field of the wContactEdit window class.
On evBefore
If len($cobj.$contents)=0
If iList.isHousehold
Calculate SortName as iList.ContactSortName
If pos(',',SortName)
Calculate FirstName as trim(mid(SortName,pos(',',SortName)+1))
Calculate LastName as trim(mid(SortName,1,pos(',',SortName)-1))
Calculate [$cobj.$dataname] as con(FirstName,' ',LastName)
Else
Calculate [$cobj.$dataname] as iList.ContactSortName
End If
Else
Calculate [$cobj.$dataname] as iList.ContactSortName
End If
Do $cobj.$redraw()
End If
Quit event handler (Pass to next handler)
The code copies the ContactSortName to the ContactFormalName if the ContactFormalName is empty. For households the last name and first name are flipped from the ContactSortName to the ContactFormalName.
It is important to end your $event method code with Quit event handler (Pass to next handler) so that the StudioWorks framework's field handler can properly decorate the field on evBefore and evAfter.
Summary
Hopefully this quick start tutorial has given you a sense of how the StudioWorks framework can assist you with rapid application development.
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.
The real learning happens when you write your own application and have to deliver it to a client.
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.
The farther you can get with using meta-data and auto-generated windows the better off you are.
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.
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.
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.
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.
The following is a recommended list of things to do as you move forward with developing your new StudioWorks application.
If you haven't already done so, print the StudioTips and StudioWorks Naming Conventions. 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.
If you are new to SQL or don't have formal database design training order a copy of Database Design for Mere Mortals 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 SQL Meta-Data Editor came from reading this book.
If you are new to SQL order a copy of Mastering SQL 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.
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.
Read through StudioTips to increase your knowledge of Omnis Studio.
Do all of the StudioTips Tutorials. The tutorials help you understand StudioWorks.
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.
Learn to use the F4 Notation Inspector along with the F6 Property Manager to see the methods and properties. These two tools are the heart of where I figure out how to write Omnis Studio notation.
Learn to use the Interface Manager. The Interface Manager shows the class methods you can call in an instance of class. Sending messages between instances of classes is a big part of Object-Oriented Programming. The Interface Manager reveals to you the messages you can send.
Learn Object-Oriented Programming. Order a copy of Building Object Applications That Work 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.
Order a copy of Code Complete 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.
Attend the StudioWorks training camps when they are held. There is nothing like in-class training. In a few days you will advance months in your application development.
Attend Omnis conferences when they are held.
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.
The next tutorial, Customizing Your App, takes you through adding custom features and code to the meta-data based auto-generated Drivers app that you wrote in the Quick Start Tutorial.