Sunday, March 28, 2010

FileMaker Pro 11: A Solid Release

When the past few versions of FileMaker were released (including FileMaker Pro 9 back in July of 2007 and FileMaker Pro 10 in January of 2009) I couldn't wait to review them and share my thoughts here on FileMaker Addict. However, when FileMaker Pro 11 was released earlier this month, I decided to wait before posting anything about it. The main reason was this: My first impression of it was one of slight disappointment, and that is something that is hard for me to say about a technology that I make my living with. So I wanted to give it a few weeks, get used to using the new release, and see what happened. I was hoping that I was missing something, and that my impression of FileMaker Pro 11 would change for the better.

Well, a few weeks have gone by, so here goes...

Let me start by saying that FileMaker Pro 11, like the past several releases, is a rock solid product. FileMaker remains the best relational database and rapid application development tools for small business and workgroup environments. If you're looking for a way to build a flexible, robust, and powerful custom solution, you can do no better than FileMaker Pro.

Let me also say that some of the features that are new in FileMaker Pro 11 are impressive, and that some have been on FileMaker developers' "wish lists" for a long, long time. (Layout Folders, which I'll discuss below, is one that nearly every developer that I've spoken with welcomes with open arms.)

So far, so good.

However, I also need to say this: It seems to me that there is nothing particularly significant about FileMaker Pro 11 that makes it a compelling upgrade from FileMaker Pro 10. Sure, things like "quick find" and charting are nice, but we've been able to develop similar functionality ourselves for a long time now. And while this built-in functionality certainly makes it easier to implement that type of of functionality, this alone doesn't justify the upgrade.

Let me dig into some of the new features in FileMaker Pro 11...

Layout Folders -- Finally! We've had script folders since FileMaker Pro 9, and we've now got them for Layouts, too. Those of you who have had to work with complex solutions that involve a large number of layouts will welcome this new way to organize layouts.


Portal Filtering -- Another nice new feature, which allows you to add portals to layouts and indicate which records should be visibile through it. For example, suppose that you have an order processing solutions, and a layout that displays an order's information along with a portal to the order's lineitems. The relationship between the order and the lineitems is based on the order number, so normally, all lineitems on the order would be displayed in the portal. With portal filtering, you can indicate that only "open" lineitems (those that have not yet shipped) are displayed. And best of all, you can do so without needing to create a new relationship on the relationship graph.





Inspector -- If you're a serious FileMaker developer, you're either going to love or hate this change to FileMaker. With the Inspector, you can control many aspects of a layout object from one window -- including the position, appearance, and data attributes. What is nice about this is that you can manage all of this in one place. However, in implementing the Inspector, FileMaker dropped support for some of the floating toolbars that many of us had grown accustomed to. This one might take some getting used to... But until we do, I think we'll take a productivity hit.




Native Charting -- You can now add chart objects to layouts, and generate bar, line, area, and pie charts. While it is nice that we now generate charts directly in FileMaker Pro, many of us have been generating them for awhile now using plug-ins or with the Web Viewer.

Quick Reports -- This one is hard to describe, but here goes: You can now create reports in a spreadsheet-like environment, and easily group and summarize data. While this might be a nice feature for a power user, I can't see letting this loose on novice users. And developers will most likely create reports just as they've always done.

Recurring Import -- This feature allows you to setup a file import, and then each time that you open your database, the import automatically occurs. This is another nice feature for a power user, but I don't see it as being of much help to a novice. And developers have been able to do this same sort of things for a long time, using scripts.

Quick Find -- This new feature allows the user to enter a word or phrase (ex: Smith) and FileMaker will perform a find for all occurrences of it in all of the fields on the layout (or in those that are flagged as being part of the Quick Find). This feature has a lot of potential. However, there is now way to allow the user to access the feature without exposing the status toolbar -- something that many developers (myself included) are still reluctant to do.


Snapshot Links -- You can now create what FileMaker calls "snapshot links" which, when clicked, will restore the found set of records, the layout, view, and sort order that was in place when the snapshot was taken. This might come in handy when it comes to helping with technical support or collaborating on a project.

New Script Triggers -- You can now create triggers that fire when entering or exiting a layout, before a field is validated, of when changing views.

Enhanced Variable Support -- You can now user variables in find requests and in merge fields. This should help us reduce the need for global variables and unstored calculations.

Invoice Starter Solution -- FileMaker Pro 11 includes a new starter solution that can be used to create, manage, and print invoices. It is a nice looking, well-organized solution that serves as a good example of how to develop FileMaker databases.

So there are lots of nice new features in FileMaker Pro 11, some of which have been a long time coming. All in all, I think FileMaker Pro 11 is a solid release, but it lacks some of the game changing "punch" that previous versions had. (Seriously, can anything ever top ESS?)

I'd love to hear your thoughts about FileMaker Pro 11...


Friday, March 26, 2010

Total Cost of Ownership White Paper Available

FileMaker Inc. has posted a new "Total Cost of Ownership White Paper" titled "Supercharging Return on Investment with Rapid Application Development Tools." Makes for an interesting read, and yet another compelling argument when pitching FileMaker-based solutions to prospective clients.

The white paper can be found here: http://www.filemaker.com/downloads/pdf/it_tco_wp.pdf

Wednesday, March 24, 2010

FileMaker API for PHP: Duplicating Find Requests

I was recently working on a FileMaker / PHP project and ran into a situation where I needed to be able to replicate FileMaker's "Duplicate Request" function. There is nothing in the FileMaker API for PHP that appears to be an equivalent to the function. However, it can be done, and this post shows the process.

In this example, the code is handling a search request against a contacts database. Users are presented with a form, and can search by name, state, and/or zip code. When a name is specified, we need to search against the contact's name (Contact_Name) as well as their assistant's name (Assistant_Name). In those cases, we're dealing with an "OR" search with two find requests, where all of the criterion of the second are identical to the first, except that we need to remove the criterion from the Contact_Name field and add criterion to the Assistant_Name field.

The following code snippet shows how it can be done...


// Create a "compound find" request.
$fm_request = $fm -> newCompoundFindCommand ( "PHP - Search" );

// Create the first find request.
$find_request_1 = $fm -> newFindRequest( "PHP - Search" );
// Find only those contacts where "Is_Public" is "Yes."
$find_request_1 -> addFindCriterion ( 'Is_Public', 'Yes' );
// If a state was specified...
if ( $_POST['State'] != '' ) {
// Add state criterion.
$find_request_1 -> addFindCriterion ( 'State', $_POST['State'] );
}
// If a zip code was specified...
if ( $_POST['Zip_Code'] != '' ) {
// Add zip code criterion.
$find_request_1 -> addFindCriterion ( 'Zip_Code', $_POST['Zip_Code'] );
}
// If a name was specified...
if ( $_POST['Name'] != '' ) {
// Add contact name criterion.
$find_request_1 -> addFindCriterion ( 'Contact_Name', $_POST['Name'] );
}
// Add the first find request to the compound find request.
$fm_request -> add( 1, $find_request_1 );

// If a contact name was specified...
if ( $_POST['Contact_Name'] != '' ) {
// Duplicate the first find request.
$find_request_2 = $find_request_1;
// Clear the contact name criterion.
$find_request_2 -> addFindCriterion ( 'Contact_Name', '' );
// Add the assistant name criterion.
$find_request_2 -> addFindCriterion ( 'Assistant_Name', $_POST['Name'] );
// Add the second find request to the compound find request.
$fm_request -> add( 2, $find_request_2 );
}

// Execute the request.
$fm_result = $fm_request -> execute ();


The code is thoroughly commented, so it should be easy to follow along. Here are a few notes:

* We're doing a find with potentially multiple requests, so we need to use "newCompoundFindCommand" and specify the criterion using "newFindRequest."
* We setup the first request, and setup the criterion based on the user's criterion.
* If the user is searching for a name, we duplicate the first request ("$find_request_2 = $find_request_1;") and then modify the criterion of the second (duplicated) request.

That's all there is to it!

MacBook Pro Video Woes

I woke up this morning to find that my trusty MacBook Pro was having problems. It had been in sleep mode, and when I woke it there was no video output at all.

Restarting it did nothing. I then tried zapping the PRAM (by pressing and holding the Command-Option-P-R keys when booting) a few times, and that didn't help.

I booted from the OSX install CD, and still nothing...

At that part, I started to freak out -- and wondered if the MacBook itself was dead. So I booted in FireWire target disk mode (see http://support.apple.com/kb/HT1661 ) and connected it to an iMac, and was able to get to the drive without any problems. I backed up everything that was important, worried that the drive might be the next thing to go.

At that point, I figured that I was probably going to need to purchase a new MacBook Pro. But I decided to try one last thing...

I rebooted the MacBook one more time, and zapped the PRAM, and... Voila! The video was restored.

I'm still not sure if zapping the PRAM an additional time resolved the issue, or if booting in target disk mode is what did the trick. But if you find yourself in the position that I was in, give this a try.

UPDATE: After another10 hours or so of the MacBook working normally, the video went out again. My "target disk mode / PRAM zap" trick didn't work. It appears that the video comes and goes, with no rhyme or reason.