Google Translate + FM Go

Here’s a little fun with the Google Translate API. This uses a very basic php page on our site, which takes what you enter as a GET request and processes it using some very cookie-cutter code from Google to do the translation.

To do this on your own site, you need your own (free) Google API Key.

The language list is taken from Google, but note that not all languages in
the list are actually supported. So if it seems to hang on the “Loading…”
screen, try another language.

Enjoy!

Cross Platform ESS? Yeah, we got that.

I just discovered the coolest thing about FileMaker ESS. Shoulda known it would work, anyway, but hey – don’t steal my thunder, OK?

So I’m messing around with MySQL on my trusty MacBook Pro. It’s almost criminally easy to create & edit MySQL schema, but as we FM developers know, schema is not the whole story – you also need business/domain logic and UI to make a solution. So, since that part of the equation is about 1000% easier in FMP, naturally when I needed a quick, mobile-friendly UI, I wired up a System DSN, hooked it into a FileMaker file, and I was off and running.

Well, almost. Maybe not running. Maybe not even moving.

See, the whole point of this thing was so I could hook into a little CMS I threw together for a band. And I wanted to be able to make quick edits using FileMaker Go on my phone. Worked great on the Mac. Worked great when the file was SERVED from the Mac. The problem was that the MySQL database was off in the cloud somewhere, and the FileMaker Server I was going to serve my FM file from was a WINDOWS server (if you’re thinking I should have thought of that in the first place, just shut up).

So, I did what anyone would do – I tried the simplest thing, ignoring all the obvious reasons it shouldn’t work. I set up a System DSN for that MySQL database on the Windows machine, using the SAME DSN NAME as the one I had used on the Mac. Then I uploaded my FMP file to the Windows server.

It worked. No difference. No changes to ESS settings, table occurrences, etc. needed at all. As long as the name is the same (along with its underlying db, host, etc. settings), it works flawlessly.

So cool. Who knew?

Big Picture Reporting without Big Picture Problems


Before the glory days of script triggers and transactional editing, us old-timers used to have to deal with something truly ugly: calc fields which included related records. You young whippersnappers won’t know what I’m talking about, but there was a time when the total on an invoice, for example, was sometimes a LIVE CALCULATION which SUMMED OTHER LIVE CALCULATIONS!!

More than a little horrifying, I know. There were some advantages, though. For example, you never had to worry about how many different layouts contained records which went into that calculation – if a user changed data anywhere, the calc would just update when needed…you didn’t have to make sure the “update” script was tied to every possible layout or any new layout the user might create.

The obvious disadvantage of this, though, was reporting. Most of the suits who sign your check on the front want to see things like “KPIs” and “Dashboards” and other fancy reports with names invented in the 80′s, and those kinds of things depend on totals of totals of totals. Totals of BIG groups of records: year over year comparisons, for example, or 10-year trends. This could involve thousands – sometimes hundreds of thousands or even millions – of records. Think about that for a second: it’s really not much work for a computer to add up thousands of numbers. But it gets a little hairy when it has to combine the results of thousands of little (or not so little) math problems. If you’re talking about a big system, better plan on going to a movie…maybe a movie marathon or two.

Enter the “robot” report. This when you have a robot system (or, these days, the server – you youngsters don’t know how good you have it!) run reports in the background, or maybe overnight, where all those math problems get done at once and assembled into a “reporting” table or pre-made versions of the reports themselves. This way, when Mrs. Boss comes in and needs to see her numbers, they can be whipped right up – fresh figures, no waiting!

Well – maybe not so fresh. If it’s an overnight report, and we’re dealing with a fast-paced business, overnight might not be quite good enough.

So what do you do? Us lazy old folk, who haven’t found the gumption to rewrite our 300-table/6000-field/500-layout systems so they take advantage of all these whiz-bang new features, still have to report on this stuff. Here are a few tips I’ve collected, which just might help, next time you find yourself with a KPI breathing down your neck:

1) Exports/imports are significantly faster than portal row creation. If you have to write a bunch of reporting records, you will save a lot of time by exporting the source and importing it into the destination, rather than looping through the source and writing to the destination.

2) Less is more when collecting data. For the layouts you run around to when setting up your exports, leave them blank, with no fields. You can still do scripted finds and exports without the fields actually being on the layouts, and layouts load much faster when they don’t have to worry about displaying anything. Also, set them to form view – that makes a difference, too.

3) Speaking of less is more, only include the fields you need when you do your exports.

4) Don’t try to rewrite the whole thing every time. Remember – the only thing that really matters is what has CHANGED. Just look for records modified “today” (or since the last report run), include keys in your export, and “update matching” in your import. You can include changes to related items in your search (i.e., search for sales orders where the lines were modified “today”). That does slow record collection a bit, but not nearly as much as relying on related calcs when reporting. If you narrow your search to only recently-updated records, you will always be dealing with a comparatively small (faster) data set. For many reports, I do this once an hour – that’s usually often enough for even the most particular CEO’s – but you can do it more often.

5) In your reporting table, don’t reintroduce the problem by having a lot of calcs & summaries. If you have to include calcs, make sure they’re local. The whole point of creating this table is to include all necessary pieces in one place, so related info isn’t an issue. Remember, you’re updating often based on changed local and related data – don’t worry about missing something – if you structure it right, that will be impossible.

All of these ideas fit very well into the current trend of “letting FileMaker be FileMaker” and capitalizing on its strengths. A simple list of records is very easy for FileMaker to search, sort, and “scriptify” quickly. Plus, without a lot of related data slowing you down, and all the heavy lifting being done on the server, this approach is FMGo, WAN, and CWP friendly – and that’s where we’re all headed. Have fun!

A Lesson from the Dark Side


Let’s get one thing straight: I love my iPhone. I love the performance, the graphics – everything. I also love FileMaker Go. But…occasionally, when trying to make a FileMaker Go layout look “native” to the phone, all those gorgeous gradients and cool-looking 3D icons can slow things down over the WAN (and that’s where most of our Go databases are deployed, right – otherwise where are we “Go-ing?”)

A small software company in Redmond, WA recently released what they hope is a competitor to the iPhone. While I wait for you to stop laughing, I will mention that there is one thing we can actually learn from this new gizmo, which can help a lot when developing for Go: the visual design is extremely lightweight.

They’ve given the operating system (which they call “Metro”) a very stark, high-contrast design. They avoid gradients and 3D pretty much everywhere. In fact, the style guide specifically mentions that icons & graphics should be “flat.” On paper this sounds a little boring and out of step with the lush, realistic graphics we’ve come to expect from Apple, Google, Palm, etc. But…when you look at it, it’s actually not that bad. In fact, I’ve come to like it. So much so that I decided to experiment with emulating it in FMG. It was easy. And the graphics load fast.

So, since my buddy Ryan has been basically kicking my butt with all the cool stuff he’s putting on this blog, I decided to share my experiment. This is a little database which is built from the tables in FMI’s “invoices” template – but with a visual design that borrows heavily from, and includes tips on recreating, Metro. Enjoy!


FP7 File

Zip File

Add/Pin Custom Filemaker Shortcut to Windows 7 Taskbar or Start Menu

If you read one of my previous posts “Open A FileMaker Database From Command Line” and were wondering when it would ever come in handy, here is a perfect example. In Windows 7 you can add programs to your Taskbar or Start menu by clicking on them and selecting “Pin to Taskbar” or “Pin to Start Menu”. Now this will only work for a program shortcut, not something you’d actually want to make a shortcut to, like a file or maybe even a Filemaker Database. For example, you will notice if you make a regular “fmp7://hostname/database” shortcut then right click on it you dont get those options to pin it to the TaskBar or Start Menu :( So there it sits….as an old desktop shortcut icon, with that big stupid arrow on it!DesktopShortcut

So you could add Filemaker Pro to the Taskbar but then you’d have to go through the whole open remote routine and we don’t want to do that! We want a nice fancy Windows 7 Taskbar icon that with one swift click goes right to our FileMaker Database….right? Ok Here’s where our previous lesson comes.
Right Click on the Desktop > New > Shortcut > where it says Type location of the new item put this in “C:\Program Files (x86)\FileMaker\FileMaker Pro 11\FileMaker Pro.exe” fmp7://hostname/database (of course replace hostname and database with your servers hostname and your target database) Click Next then give it a “Name” and your finished creating your shortcut.

Custom FileMaker Shortcut for the Taskbar or Start Menu

Now you can just change the icon to your own and then right click on it and either “Pin to Taskbar” or “Pin to Start Menu” or what the hell….add it to both!!

Custom FileMaker Taskbar Button

FileMaker Nagios Plug-In

Monitor the FileMaker Databases on your clients. Even if the server is up and running that doesn’t mean the databases are. This  php script was made to work in Nagios but can also be used on its own.

Listing on Nagios’ website:

http://exchange.nagios.org/directory/Plugins/Databases/FileMaker/check_filemaker/details

Download URL:

http://download.reliablesoftworks.com/check_filemaker.tar.gz

#What: Nagios check_filemaker.php plugin
#Intended For: Filemaker developers who want to monitor their clients’ databases using Nagios.
#Required: php cli with cURL extension. Filemaker API (included),FM Web Publishing configured correctly.
#Quick Description: This script uses the FileMaker PHP API to run a listLayouts() query a server database.
#Why?: Sometimes a check_ping or check_service doesn’t tell you enough.
If your FM Database Server gets hosed and people cannot connect to the databases these checks will never notify you.
#Detailed Description: Uses a provided Database, Hostname, Username, and Password as arguments.
They then get passed to the PHP command line as:
php check_filemaker.php -d $ARG1$ -h HOSTNAME -u $USER2$ -p $USER3

The best way to implement this script is to have a generic username and password.
1.
EDIT: /usr/local/nagios/etc/resource.cfg (add them here so the whole world doesn’t see them)
ADD: macros for username and password ($USER1$ is already used for libexec path)
$USER2$=HiMyNameIs
$USER3$=SecretWord
***read the resource.cfg file and dont be an idiot and try to change the macros to something else.
2.
EDIT:/usr/local/nagios/etc/objects/commands.cfg
ADD: check_command
# ‘check_filemaker’ command definition
define command {
command_name check_filemaker
command_line $USER1$/check_filemaker.php -d $ARG1$ -H $HOSTADDRESS$ -u $USER2$ -p $USER3$
}

3.
EDIT: /usr/local/nagios/etc/objects/clients-fmserver.cfg
ADD: service definition
#’check_filemaker service’
define service{
use generic-service
host_name clients-fmserver
service_description FileMaker DB Connection
check_command check_filemaker!DataBase
}

***Obviously change DataBase to whatever your database name is that your connecting to.
4. tar zxvf check_filemaker.tar.gz to /usr/local/nagios/libexec/ directory
change ownership of files to nagios user
chown nagios:nagios /user/local/nagios/libexec/check_filemaker.php FileMaker.php
chown -R nagios:nagios /user/local/libexec/FileMaker

make check_filemaker.php executable
chmod 744 /user/local/nagios/libexec/check_filemaker.php

Open A FileMaker Database From Command Line

How to open a FileMaker database from the command line. I Didn’t see much on the internet about this so I thought this might be helpful.  This is helpful for us because we use a program to manage our clients that use our software. This way we don’t have to use Open Remote.  All you do is pass the regular FileMaker URL fmp7://server/database as a parameter to the Filemaker executabale. For Example:

Windows: “FileMaker Pro.exe” fmp7://hostadress/DataBase

MAC: open FileMaker\ Pro.app fmp7://hostadress/DataBase

or take it a step further

Windows: “FileMaker Pro.exe” fmp7://username:password@hostadress/DataBase

MAC: open FileMaker\ Pro.app fmp7://username:password@hostadress/DataBase

Be careful how you use this. Don’t make it easy for someone to see that command and steal your usernames and passwords.

The program we use stores the passwords encrypted and uses its own variables to formulate that command.

Like So: 

“Filemaker Pro.exe” fmp7://%username%:%password%@%hostaddress%/%DataBase%

Hope This Helps!

What a glorious day

Today the blog has finally been created. We’ve been wanting to start this for awhile but we’ve been so busy..Now we get to blog blog blog to the world with all our great ideas and updates.