FileMaker Server 9 – server-side ScriptMaker scripts

One of the great new features of FileMaker Server 9 is the ability to schedule regular ScriptMaker scripts (i.e those that you create with FileMaker Pro/Pro Advanced). FileMaker Server has had the ability to perform system-level scripts since at least v5.5 as far as I can recall (e.g. Windows batch scripts for Windows and AppleScripts for Mac OS) but v9 allows you to schedule ScriptMaker scripts as well. This allows administrators to schedule batch processes to take place on the server or after business hours, for example for batch processing records for end of day processing.

The only limitation is that, like with Instant Web Publishing, the scripts must be “web compatible”:

The screenshot above shows the standard ScriptMaker script dialog box. In the bottom left hand corner there is a checkbox to indicate web compatability. With this ticked all web compatible scripts are left in black and non web compatible scripts are greyed out. So remember when creating scripts that you intend to schedule on Server 9 you must include only the web compatible script steps as indicated. I haven’t done any tests to determine what happens with non web compatible script steps to see if they are simply ignored or the script stops executing at that point.

Whilst working on the finishing touches to our new CRM product Data Manager I came across the idea of utilising the ability to schedule ScriptMaker steps in FileMaker Server 9 which will be the standard base version for multi user clients. We have routines that perform batch processes and use the Troi Dialog plugin to display a progress bar whilst the script is running to give feedback to the user. Unfortunately this means the user cannot use FileMaker whilst the script is running, for example when sending a bulk email to 500 customers. If it isn’t urgent that the email is sent immediately we will have the ability to set the batch operation to be scheduled so that the sending is actually performed by FileMaker Server, which will not interupt the user and can be performed out of business hours (less disruption to Internet connection) and makes better use of the Server’s resources. You can even use the new email notification feature to get feedback via email about the scripts operation, however you will need to build in some interface to allow clients to review batch operations to check for sending errors (e.g. Internet was down). Most plugins use the Set Field script step which is web compatble so it’s easy to use plugins that don’t rely on keyboard/mouse input and dialog boxes.

You can get more information on Server 9 script scheduling at:

FileMaker Web Viewer and Data URL’s

Whilst working on our new CRM (Customer Relationship Management) solution – Data Manager – this week we made an interesting discovery with the way the Web Viewer works. We wanted to have a way to preview an html email that was being composed in Data Manager so the user could see how it will look to the recipient, just as it does in Outlook etc when composing a new email. We also didn’t want to have to keep exporting files and then opening the exported file as that creates unnecessary clutter for the developer and the customer (though with FM Pro 9 you can use the new Get(TemporaryPath) function to dump files into the user’s temp folder. We investigated using a Data URL with a Web Viewer as this would provide a “live” view of the content. This works well for plain text type emails with no inline images as you can simply reference the fields using something like:

“data:text/html,” &

Substitute ( DM_Email::email_text ; “¶”; “<br>”)

This replaces any FileMaker carriage returns with the HTML equivalent.

However if you’re using email stationery like you can in Microsoft Outlook you might be referencing one or more inline images (gif, jpeg, etc) which are stored in a folder on the hard drive, server etc. This makes things a bit more complicated. Fortunately we have a table in Data Manager that stores all the inline images for each user which stores the path, file name and a copy of the image in a container field as well. Whilst scratching our heads trying to work out how we can do a substitute calculation to change any image references which might be:

<img src=”banner.gif” mce_src=”banner.gif”

<img border=”0″ src=”clickhere_btn.jpg” mce_src=”clickhere_btn.jpg”

we made an accidental discovery. If you export the contents of the container fields to the user’s temp folder using the Get(TemporaryPath) function the Web Viewer will somehow “discover” the images and show them when displaying the preview of the html email. This made things a lot easier for us as we don’t have to deal with complex substitutions in the html source (we’ve only tested this on Windows XP and have since heard this doesn’t work for Mac users but we haven’t had a chance to test on a Mac yet). We’re also big fans on the SMTPit Pro plugin which has a nifty function for converting rich text into HTML on the fly which makes this so much easier.

You can read more about the Data URL scheme at:

http://en.wikipedia.org/wiki/Data:_URI_scheme

http://www.ietf.org/rfc/rfc2397.txt

There’s also some good info on FileMaker and Data URL’s in the Web Viewer with some example files at:

http://sixfriedrice.com/wp/filemaker-9-tip9-web-viewers-without-the-web

http://www.nightwing.com.au/FileMaker/demos9/demo908.html

http://www.nightwing.com.au/FileMaker/demos9/demo901.html

New Website Launched

Our new website was launched this week. We’re still working on the content side of things and some additional functionality that will involve PHP and MySQL (we will be able to access these MySQL databases using the External SQL datasources feature of FileMaker Pro 9). Stayed tuned!

Posting XML Data

I’ve been working with some web services lately that require some XML data to be submitted as a POST. FileMaker Pro can import XML data from a .xml file or from an HTTP request (and use a XSLT stylesheet from a file or an HTTP request). However XML can only be exported to a .xml file which limits it’s usefullness when working with web services. I managed to workaround this using the Troi File Plugin and the Troi URL Plugin from Troi Automaterising (we’re big fans of the Troi plugins).

For one customer we exported the XML data using a stylesheet then read that .xml file back into the FileMaker solution using the Troi fil plugin. We then used the Troi URL plugin to POST that xml data directly to a web service. We then had to parse the XML that was returned and isolate a URL which we could then view using the Web Viewer. This all happens within a few seconds.

For the other customer the XML wasn’t particularly complicated so we crafted the XML using FileMaker calculations and posted that.

zippScript Plugin

I’m a big fan of FileMaker Plugins and use them extensively in my solutions as they allow me to implement features that are not native to FileMaker Pro. I’ve spent some time lately with the zippScript plugin developed by John Kornhaus [Updated October 10 to remove the link to the zippTools website as John Kornhaus has advised he is no longer able to distribute the plugin). This is an event plugin that lets you trigger scripts based on certain contions, such as when exiting a field or committing a record. You can also schedule scripts to be run at certain times.

Another freeware plugin that I’ve started to look at is the MooPlug which has a number of handy functions and you can’t complain about the price.

FileMaker 9 Certification

FileMaker Inc have just announced that the certification test for FileMaker 9 is now available. I plan on attaining certification for FileMaker 9 as soon as possible to complement my certification in v8. I have my copy of the FileMaker Training Series which I will review before sitting for the test. Hopefully I can announce that I passed the test in the next few weeks!

FileMaker Pro 9 and ESS

I’ve spent some time over the past few weeks using the new External SQL Data Sources feature that is part of FileMaker Pro 9 and I have to say I’m pretty impressed. I’ve started using it internally to do something I’ve been dreaming of for many years – live integration (no import/export) between and internal FileMaker CRM system and an external web based SQL database. With work on my new website almost complete I’ve been building some MySQL databases for the usual tasks of feedback, product suggestions and other web based forms. In the past I would receive emails when these forms had been submitted and copy/paste into a FileMaker database. Now I can view these MySQL tables from within FileMaker Pro 9 at the office. I’m impressed with the speed and responsiveness so far and also how you can set this up on FileMaker Server 9 so you don’t have to worry about installing ODBC drivers on all the workstations.

If you’re getting started with ESS and FileMaker Pro 9 I would recommend the public ESS Tech Brief and if you’re a TechNet member there’s a more detailed technical version available in the TechNet members only area. There’s also an article in the March 2008 issue of FileMaker Advisor by the same author as the tech briefs available from FileMaker.

Finally make sure you use the new Refresh Window menu command (under the Records menu) or have a button/script that uses the Refresh Window [flush cached SQL data] script step to update your ESS views.

I also tested ESS with WordPress which uses MySQL as the database backend and I can view the WordPress tables in FileMaker Pro 9 too!

Welcome to the Databuzz Blog!

Well this is my first post to my new blog. I’m using the WordPress blog software and it took just under 1 hour to install and setup and I’m pretty impressed. Once my website is up and running I’ll be posting blogs about Databuzz and FileMaker.

 Andrew