Visual Dataflex RAD Database | Software Development

By: Peter A Donovan

*Visual DataFlex is a trademark of Data Access Worldwide of Miami.

Here's a conceptual step-by-step methodology for creating your first Visual DataFlex application.
Visual DataFlex is a "transparent back end" database application studio where the same exact code runs on your choice of backend.
This overview assumes you will start with the native DataFlex backend as a starting point.
To encourage you to try the Visual DataFlex studio for a test drive using [freeware] the Personal DataFlex edition licensed for personal but not commercial use.
This is a full studio deploy with no restrictions other than mentioned above.
Compelling Reasons:
You can produce a fundamentally solid application in ? the time as your current studio.

First, let's assume you have the studio downloaded from and you are running on a 30 day eval prior to getting a license.

If you fire up the Visual DataFlex Studio, you've got the "order entry" sample example workspace automatically loaded for you, and the current project is "Order.src". From this point, you should hit [F5] and the "source code = src" will compile into an executable and run. Please check out the features of the running program. This, we will code ourselves in a new "SRC" project to see how it was done.

1.From the menu, choose File-New-Project-Windows Project, and you will get a dialog asking for the .EXE name.
2.Please type "Test" and press ok.
3.For fun, just hit [F5] and compile an executable, which you will find is a perfect MDI [multiple dialog interface] container with no functionality BUT... the button bar, menu headers, and runtime are all done.
4.Back in the Studio, let's create a data entry program or form if you will. Click File-New-View/Report-Data Entry View Wizard, and click Ok.
5.From the wizard, click "next" on the opening page.
6.For an object name, please enter "oSalesOrder" and accept the defaults for the next 2 windows and click "next".
7.Next page: change the radio button please to select "create a header-detail entry view" and click "next".
8.Now, the time has come to select the CHILD table for the data entry view, so highlight "OrderDtl" and click "next".
9.For the "header" data table, we will select "Orderhea" and click "next".
10.Now, we select the columns "fields" to show in the data entry HEADER section, and I recommend: Choose ALL the columns from the OrderHeader table EXCEPT the last one [last detail number] and click "next".
11.Now, we select the columns "fields" to show in the child grid below the header, and I recommend: Choose ALL the columns [except for the FIRST : ordernumber] from the detail table and click "next".
12.Next, you get to customize the labels for each of the forms if you like, but the default has already been programmed into the datadictionary, so simply change the radio button to "right" justify the labels, and click "next".
13.and "Finish".
14.Press [F5] which auto-saves and compiles your SRC into a EXE and test!
15.You now have a running program [under the view menu] which actually saves sales orders and detail lines. Not the most appealing visually, but structurally sound.
16.You will find that there are entry methods associated with some database columns, and exit methods associated with some. You MUST find a parent table record in order to save, and you MUST fill in some required fields. There's a snazzy lookup list [expandable] for each of the associated tables, and some columns automatically are instantiated as comboforms for you automatically. A couple of small modifications later and we are on the road to deploying this. [omitted].

This is just a sample of the power of Visual DataFlex, and a few words of explanation are required to answer questions that this may have raised.
&bullThe datadictionary for each of the tables has been pre-coded for you in this sample example.
&bullThe datadictionary for the parent tables adjusts automatically, knowing that it is used as a parent reference, to be "find required" in an excellent display of polymorphism. The same exact table behaves differently when it is the main table for data entry, i.e. no "find required".
&bullThe key fields/columns of each table cannot be changed: they are protected from change via a checkbox in the datadictionary.
&bullThe labels for each column are configured in the datadictionary so they appear consistent throughout your application.
&bullThe lookup lists, called selection lists are assigned to a table-column in the datadictionary so they automatically appear with a prompt button with no code.
&bullThe Order Header TOTAL automatically adds and subtracts based on what you do with the lineitems: delete/save new/change.
&bullThe Product on_hand total automatically adds and subtracts based on what you do with the lineitems: delete/save new/change.
&bullFor a real LASTING impression of visual dataflex, please note the quantity onhand of a lineitem product, and then CHANGE the product in the lineitem without changing the quantity. Then, choose the lookup, and you will see that the lineitem quantity has been moved back INTO inventory for the product you changed. Note: there are about 5 lines of code in the datadictionary that make this happen!
&bullNow, for real fun..., place the cursor in the header section on customer and choose DELETE from the button bar. Surprise, the customer is not deleted but the entire order and all of it's lineitems are deleted. Repeat: place the cursor on the product code column of an existing lineitem and hit DELETE. The product is not deleted, but only the lineitem.

By this point, you may be ready to give the datadictionary a once-over!
1.From the Studio, select Tools-Database Builder. This utility creates the CLASS that each datadictionary object [in your entry form] is based on.
2.From the "Open Table" pulldown, select "Order Header" and browse thru the settings. It's extremely impressive I think in the maturity of the product.

Ok, you want to give Visual DataFlex a shot, but where do you go for help?
&bullThe Visual DataFlex newsgroup: The url is:
&bullPlease introduce yourself as a new developer and we will welcome you with advice and support.

Thanks for giving Visual DataFlex a trial, and look forward to seeing you on the newsgroup!

Peter A Donovan
www.ApplauseSoftware.Com of Boston, USA.


» More on Computers