Posts

Create A Map Using FileMaker I

Today I was asked to create a map using FileMaker to show all the students that are accepted to my client’s school. The client said the Department of Education needs to map out the bus routed for the students. He said he DOE may not want to provide buses for a child if he/she lives too far, and we need to make an argument that the child should be bused to the school.”

So at first I thought about what software/plug-in I should use, then I realized I can create a map with Google Maps with layers. Especially, since this map we can’t just have in the database but rather we need to share it with the DOE. Turns out this was the easiest task, ever, so I thought I’d share the steps.

  1. Export the data you want to be mapped in CSV format. I wanted to see kids and their location (full name, address, city, zip);
  2. Create a Google Map here: https://www.google.com/maps/d/u/0/;
  3. Add a new layer, name it whatever you want to import your data into;
  4. Import the CSV file. It will ask you to dedicate the data for the pins (address) and the next step is to dedicate a column for your label (full name);
  5. Change the color of the pins;
  6. Add more layers with more data if needed (in my case my school is the other layer).

And here is the finished product:

 

Screen Shot 2015-07-15 at 1.12.44 PM

FileMaker and PHP: Link to A Record Using Redirect

Let’s Learn How We Can Link to A Record Using Redirect

In this article we’ll look at how you can link to a record using redirect with FileMaker and PHP.

In later versions of FileMaker we have Snapshot Links. When you work in a database you can always give someone a Project number when you need to refer to a Project. Or we can script generating a Snapshot Link. The problem with the Snapshot link is that you’ll have to remove it once you spit it out to the Desktop. AppleScript can help with that.

Another method is the fmpURL protocol. You can generate nice links such as this:

fmp://localhost.com/SomeDB.fmp12?script=open_project_link&param=PROJECTID

Then if you copy and paste this into apps it’ll open the database. If you’re on a Mac and use Messages or email this is great!

But then I ran into a problem where my client’s law firm relies on Gmail for their primary communication AND they are using it from a web browser. Now, Gmail DOT NOT know what to do with the FMP protocol so it just breaks the URL and funky things happen. I’m sure Gmail is not the only party here that does not know what to do with it.

So one—fairly simple method—of tackling the problem is referring to good old, creating a link to a record in FileMaker with PHP. I know, this is not a novel method but when I was looking for it I couldn’t find a comprehensive article on how to achieve what I want.

What you need:

  1. A web server
  2. A PHP file
  3. A script in FM that will know what to do with the parameter it receives
  4. A button on the layout to run another script to generate the appropriate link to call your redirect PHP

Any web server anywhere will do. You just need to place a very simple redirect PHP file on it. Name it “redirect.php and place it in the appropriate document folder of the web server. Make sure the file has the proper (read, execute) permissions.

The PHP file:

<?php

//gets the query string for the value of ‘project’
$project=$_GET[‘project’];
//concats url with ID from query string.
$url = “fmp://YOUR_FM_SERVER/Database.fmp12?script=SOME_SCRIPT&param=” . $project;
//redirects to new page.
header(“Location: ” . $url);
?>

The FileMaker Scripts

  1.  You need a simple script that the PHP file will call. It will need to define the received parameter and perhaps search for the aforementioned project by ID. Obviously the script can do more, depending on your business process.
  2. And the script that calls your redirect.php on the webserver. It should generate and copy your link to the clipboard:

    http://YOUR_WEB_SERVER/redirect.php?project=PROJECTID

Then that link can be pasted anywhere and will be clickable.

Protecting Customer Data – Solutions For A FileMaker Developer

In the process of creating solutions for their clients, FileMaker developers often find it easier to put the client’s database(s) on their own desktops, notebooks or servers rather than connecting to a remote computer. A lot of clients I deal with don’t pay too much attention to security, and it’s our job as developers to keep their data secure, whether it’s in the database or we’re talking about the database itself, especially during development. My take on this is very simple: if others mean harm, no security measures will keep them away from attaining their goal. However, as a technology specialist, it’s my duty to take measures to keep customer data safe. In this article, I am concentrating on three topics:

  1. Securing your computer
  2. Securing your FileMaker data
  3. Secure backups

The purpose of this article is not to cover anything and everything under the sun, but to remind you of best practices and give you some ideas about how to approach things. Also, I use a Mac, so if any of these things don’t work on Windows or if you’d need to do things differently, feel free to comment.

Securing Your Computer

  1. Assign a Password. While your sister’s computer may not need a password to log in with, as a developer I highly recommend you disable automatic login and give yourself a nice, at least 12 character-long, secure password. Secure means that you do not use the same password everywhere. If you need a tool to help you manage and keep passwords and even generate secure passwords for you, 1Password is the best I’ve seen.
  2. Eikon Fingerprint reader. If you need stronger security than a password for your notebook, I highly recommend the UPEK Eikon to Go Digital Privacy Manager for Mac. It’s a portable security device that fits on your keychain and can be with you wherever you go.
  3. Securing your passwords. Whether you are logging into a web site to pay your taxes or logging in to manage your email preferences from a newspaper, it is important to have secure password. In this age of increasing identity theft, this is getting to be more and more important. Below are a couple of tips on achieving this:
    1. Choose passwords that don’t contain personal information but are easily remembered. How do I know if my password is secure? If you have at least 12 characters and at least one number and a special character and your password does not read a full word in English, you’re onto a good start. There is a lot of literature on choosing passwords out there; here’s a good one from Microsoft.
    2. Don’t reuse your passwords. Make sure the websites for your bank accounts and credit cards have different login information. Don’t make it easy for people to gain access to one password and take everything from you.
    3. Use 1Password (or a similar utility) that is available for both Mac and Windows, iPhone/iPad and now Android, as well. Take your information with you securely, so you don’t have to remember all this useless information; instead, look them up when you need them. 1Password can also generate and store secure random passwords for you. Its keychain file can be synced to multiple machines (and the Android app) via Dropbox, so you can maintain your info on one device and it’ll be available to you on all of your devices (where applicable).
    4. Change your passwords every couple of months. Don’t be lazy about it. If someone gets hold of your information, it takes longer to get your money back from a bank than to change and store your password.

Securing your FileMaker Data

  1. Have a server (hosted or local). Have your files not be accessible to anyone locally but the FileMaker developers. This means not having the files on your File Server and NOT sharing the files with File Sharing. This can cause serious corruption in your database if a hosted file is opened locally and renders your file unusable.
  2. Convince your clients (yourself) to use privilege sets/accounts and passwords to manage the data in their FileMaker databases. People might not think it’s important but prevention is the best security measure. Give people access to what they need, no more and no less, to reduce human error.
  3. Make sure all of your FileMaker databases have passwords. This is especially important if you use the Data Separation Model. If you leave your data file unprotected, why bother putting a password on your interface file?
  4. Try to make sure users cannot set up an external file to have access to all your data in your main file. FileMaker Pro/Advanced 11 really helps with this. Previous versions allowed you to create references to your file. FileMaker 11 gives you an option to prohibit access with older versions of FileMaker and to require full access when creating references to your file. If security is important in your environment, it’s worth upgrading just for this.

Securing your FileMaker Backups

Backup, backup, backup. One can never emphasize this enough. Decide based on your server how often it can handle backups without causing serious hiccups in your environment. Let me give you an example. I used to have a FileMaker Server on an older XServe in an office environment. We did backups every hour and the databases paused for minutes, every hour on the hour so the backup can be performed. It was painful for 40 employees. I purchased a new XServe, moved the files to a RAID, and when the backup schedule ran every 30 minutes, nobody even noticed it. You can find a lot of literature on how to do backups. I suggest that you backup hourly, daily and weekly. Then move some of those backups offsite. One of the offsite solutions is Amazon AWS, but there are others. I use Amazon AWS in conjunction with 30Works’ SafetyNet. All my clients’ files that are stored on my server for development are backed up every night, so I can sleep well. The service is cheap and setup is a breeze. If anything happens, all you have to do is install SafetyNet on a different machine (anywhere in the world) and you can get back to work in minutes.

  1. Test your backups. It’s not enough to just have them sit somewhere. Open them up on occasion and test them to make sure there is no visible corruption. Don’t wait until something happens and then you realize your backups from the last 3 months are corrupt.
  2. Create clones on a regular basis of your healthy files. Same reason as above.

 

FileMaker Server-side Scripting

Running scripts from FileMaker Server can dramatically reduce execution time. I have been an avid fan of server-side scripting since it was introduced in FileMaker 9. Now, with the introduction of FileMaker Go it is more important to take the burden away from the client and do as much processing on the server as possible. There’s no need to bog down a client when the server can take care of the task in the fraction of the time it takes to run from client. You can use server side scripting to automate record updates from external sources, prepare those pesky Monday morning reports so they are printed by the time everyone comes in or simply use it to update stored data instead of using calculations.

You can run FileMaker scripts or System Level Scripts or even combine them to run a script sequence now! This article deals with FileMaker scripting.

We tend to think, now that we have this feature, we can just build our scripts, run them from server and be done. This isn’t quite true…we have to follow up with the all-important troubleshooting period. At least in my experience, there is no server-proof script that can be installed on a server without further testing and digging and modifications.

So, I collected some pointers from my–and fellow FileMaker developers’–experience that might help you speed up your development when running scripts from server. Don’t be discouraged. You will be happy with the results. Jump in and put some of those tedious scripts on the server, so you and your users can forget about them.

Things to know:

  • Make sure all your script steps are server compatible (choose “Server” under “Show Compatibility”–bottom left corner of “Manage Scripts”).
  • The server runs the opening and closing routines, so you might want to revise your “onOpen” and “onClose” script to bypass some steps that are not relevant to the server.*
  • Globals are set. This may not be an issue, but might be worth paying attention to.
  • No need to script opening a new window, because the server does not execute the scripts from physical windows, but rather a virtual space.
  • If you are referring to an external file in Manage/External Data Sources, folder names have to be hard-coded in the string (such as file:/folder name/folder name/file name.fp7 or filewin:/ if you are on Windows Server).
  • Import locations can only be either:
    • the Documents folder within the Data folder under the FileMaker Server root on your server machine (you can use Get ( DocumentsPath) to get you the right path; Windows users, don’t forget to use the “filewin” prefix);
    • the Temp folder (you can use Get ( TemporaryPath) and see the notes above).
  • Watch the log after you set your script to run, it can only help you!
  • Set up notification emails so you can be aware if something went wrong (you can turn these off after awhile).
  • Errors reported are FileMaker errors, not server errors.

Some caveats:

  • Lack of instant feedback. Even though you test until death locally, new problems can arise when running from server. Put in error checking after every step. I would also highly recommend logging script times.
  • You have to disconnect the client that runs the server script if a script hangs.
  • The script will hang if you forget to put in the “Perform Find” script step (possibly other actions or lack of them can hang the script, as well).

That’s it for now, but I will be adding to this article, so feel free to check back on occasion.

* I usually set up an account called “fmserver” to run the scheduled scripts with. Then I edit my onOpen script to bypass the opening routine if the account is fmserver. That can cut down on time and avoid unnecessary script steps.

Credit: Steven Blackwell, Todd Geist

 

Agnes Riley presented the FOCUS Framework to the NY FileMaker Developers’ Group

On June 10, 2010 Agnes Riley of ZeroBlue presented the FOCUS framework to the NY FileMaker Developers’ Group. The demonstration included the main features of the free FOCUS framework, from how to quickly create tables and layouts and how privileges allow/disallow navigation. Participants also learned how you can modify the framework with your own design: theme and icon set. For ZeroBlue development starts with the FOCUS framework. It enables the developers to get a project off the ground in significantly less time than if created from scratch. The framework also comes with a large number of invaluable custom functions such as Geoff Coffee’s function for passing variables and several other ones by Will Baker. The modified version includes custom search and QuickFind capabilities. While this version of the framework was created for FileMaker 10, it works just as well for FileMaker 11.

The framework was developed by Vincenzo Menanno and Will Baker of Beezwax and can be customized to each customer’s needs.

To learn more about how your database can be created by using the streamlined FOCUS framework to cut down on development time, please contact us.

 

 

Exporting Container Field Contents To Folders From FileMaker

Someone asked me today to help export container field contents. The additional requirement was to store the images in unique folders (because the container field contents might not have unique file names). I have created a short video to share the process with people:

Click here to watch this video in high resolution.

I highly recommend replacing your old method of storing images in container fields with a new method: SuperContainer from 360 Works. It has a lot of advantages, one of them is reducing the file size tremendously. I use SuperContainer in almost every solution I build.

Download demo file

Special Thanks:

I’d like to thank the following people for their help in getting me on the right track here:

Steven Blackwell
Lee Hoong
Bruce Robertson

 

Adding shortcuts to FileMaker on Mac OS X

I have a seen a lot of complaints on mailing lists about shortcuts – that developers are used to – that are now missing from FileMaker 11. I may not be able to help restore those shortcuts, but I would like to show you how you can add shortcuts to menu items that do not have one.

Click here to view the video in high-quality.

In addition, you can invoke the “Inspector” by hitting Command + “I”, and you can switch between the tabs by hitting Command + “1” for Position, Command + “2” for Appearance and Command + “3” for Data.

 

Importing RSS Feed Into FileMaker with XSLT

Update:

Per popular request I am revisiting this article. I made some edits and also now you can download the the demo file.

Someone sent an email to our FileMaker group to request information about importing RSS feed into FileMaker. Since I have done this and it’s actually quite easy, I thought I’d post the method here.

Ingredients

  1. FileMaker (8.5 or later because you need Web Viewer);
  2. A FileMaker database ;
  3. An XSLT style sheet; (I found this style sheet somewhere some time ago; didn’t write it myself)
  4. A web host where you can post the XSLT file;
  5. An RSS feed that actually works with this (e.g. Yahoo Stocks: http://rss.news.yahoo.com/rss/stocks);
  6. A script that pulls the info (which now can be run on server if you have FMS 9 or 10);
  7. A table in your DB for storing the RSS feeds;
  8. A portal on your layout that shows the list of RSS feeds;
  9. A web viewer in your database that can display the resulted web page;
  10. A script that tells the web viewer to show the requested article.

 

Directions

  1. Create a new table called ‘RSS_Feed’ in your solution (since this only works in FM 8.5 and later, there’s no need for a separate file). Create the following fields: ID, Title, Description, Link, PubDate, SelectedLink;
  2. Link the new table to your preferred table (Global, Solution, etc.) by showing all records (‘x’ symbol);
  3. Create a new layout in your solution, place a portal on it showing the records from the RSS Feed table (link and description fields, minimum). Place a web viewer next to it. Name your web viewer object “article”;
  4. Create a script similar to this example to refresh the feed (you can run this script from a button on your layout or at certain intervals from the server):
Go to Layout [ "Layout Name" (Table Name) ] Enter Browse Mode Show All Records Delete All Records [ No dialog ] Import Records [ XML (from http): http://rss.news.yahoo.com/rss/stocks; XSL (from http): http://www.website.com/folder/rss2fmp.xsl ] [ No dialog ] Go to Layout [ original layout ] 
  1. Create a script for showing the article:
 Set Field [ RSS_Feed::SelectedLink; RSS_Feed::Link ] Set Web Viewer [ Object Name: "article"; URL: RSS_Feed::SelectedLink ] 
  1. Turn your title field on your portal into a button and link to perform the script above.

This is most likely not the only method; it may not be the best method either. It is, however a working method.

Any questions, suggestions, feel free to respond.

 

Demo of the FMTouch iPhone App with a FileMaker database

Photo by Sandy Hechtman

December 11, 2008: Agnes Riley presented a FileMaker-made-mobile solution to the members of the New York Motion Picture Collective and the New York FileMaker Developer Group. The presentation demonstrated bringing a database from FileMaker to the iPhone through the use of FMTouch.

Click the images below to get a closer look:

Click the image below to see the video:

Now, let’s look at how this is done. To get started with porting your own database to the iPhone or iPod Touch, you will need the following:

It may seem daunting at first, but these simple steps will allow you to begin:

  1. Design your layouts you would like to use on the iPhone according to the style guide;
  2. Buy FMTouch form the iTunes Store;
  3. Download the synch plug-in and place it in your FileMaker?s extension folder, then restart FileMaker.
  4. Make sure the plug-in is enabled.
  5. Set up synching to your database on the iPhone (check the User?s Guide for more on this);
  6. Transfer DDR to iPhone;
  7. Name your Database;
  8. Initialize DDR;
  9. Choose the layouts you want to see;
  10. Re-initialize;
  11. Synch your database to get the data from the computer;
  12. Open your database.

Congratulations! Now that you have a FileMaker database working on an iPhone or iPod Touch, here is a list of tips and tricks that might be helpful to you, as well as observations to be mindful of as you move forward in your own development.

LAYOUT DESIGN

* You can design the layouts based on the example DB and provided style guide. Make sure you pay attention to scrolling with fingers. If you don?t want editable fields to get in the way of scrolling, make sure to lock them down.
* With FMTouch you can show layouts in ?portrait? (vertical), ?landscape? (horizontal) or ?both? modes. The iPhone is not able to differentiate between layouts whether they are designed for portrait or landscape modes. So you cannot simply rotate the phone in the hope that it will switch to a different layout. So, at this point you?re better off locking FMTouch to either vertical or horizontal mode, which you can do if you go to ?Settings? after you click on the little ?i? on the bottom right.
* Every time you change the layouts you would like to show, you have to reinitialize your solution.

LABELS

FMTouch is currently unable to show more than one line in a label showing text on the layout. You can, however, use two different workarounds:

  • You can type every line of text into a new label;
  • Or you can create a calculation field with the text you would like to show and place that on the layout.

FIELDS

You can use container fields in layouts, but they can only show a reference to an image. Only import the reference when you import an image; it will not show in FMTouch otherwise.

SCRIPTING

You can use the following script steps attached to a button on a layout:

  • Go to Layout*
  • Go to Record
  • New Record
  • Delete Record
  • Set Field
  • Go to related record.

* Note: You can use the ?GoToLayout? script step directly from a button, but you cannot use this script step as part of a script, because ?Perform Script? is not a supported script step.

Special thanks to Christina Tsao for her help with the database layouts.

Downnload the instructions (PDF)

I hope this has been helpful.

 

Evernote

This is exactly how I envisioned my application over a year ago, when I started working on it with some developer friends, except one or two EXTRA features, which I am not going to elaborate on.

Evernote, however is an excellent application for collecting notes from the web or your head and then syncing them automatically to different platforms, such as your iPhone. I have already made a nice FileMaker-related notebook on my Mac desktop app from different sources. The information can be tagged and is searchable, as well as you can email notes as PDFs automatically. Two thumbs up, Evernote!

In the image below you can see my collection of FileMaker-related notes:

 

[cta title=”Get Custom Development” btnurl=”/contact” btntext=”Contact Us” btncolor=”blue”]

At ZeroBlue we shine at building custom FileMaker solutions that do exactly what you need them to do with a focus on ease of use paired with crisp interfaces.

[/cta]

Portfolio Items