"No Holding Back FileMaker Blogging"


Navigation:


Support this site by clicking on a sponsor below or becoming a patron!



Create a FileMaker Calendar



Become a patron of this FREE web site!


Recent Blogs:

Window Locking
Window Locking

Everything Changes
Everything Changes

Subsummary Unique Count
Subsummary Unique Count

Scripted Change Log
Scripted Change Log

Abstracted Log
Abstracted Log


Meta-Consulting
Meta-consulting is a service Database Pros offers to help other developers over programming hurdles via GoToMeeting. Email John Mark Osborne or call John Mark at (909) 393-4664 to find out more about this service.


Create a Password Management solution!


Quick Tip:

Enter Text Format Quicker
I've never seen this documented, but just today, while in Layout mode, I double-clicked a field while pressing the Option key on my Mac and, suddenly, I was in the Text Format dialog. Iíd always hoped that there was a shortcut to get there, but I kept expecting to see a key-combination. Who knew? You can do the same under Windows by holding down the Alt key. Compliments of Reeva Golub.



Beginner, Intermediate and Advanced Video Training


Fun Stuff:

FileMaker, Inc.
FileMaker, Inc. or FMI is a wholly owned subsidiary of Apple, Inc. It was once named Claris when it also sold MacWrite, MacPaint, Claris Emailer, ClarisWorks, etc. but changed it's name in 1998 when it focused on FileMaker. FileMaker started out as a DOS application called Nutshell but was shaped into the powerhouse it is today by Claris and FMI.



Tips & Tricks Videos







RSS Feed
FileMaker Eighteen
Level: Intermediate
Version: FileMaker 17
Category: General
Wednesday, May 22, 2019
Eighteen is the age you become an adult in the United States. In China, it's an auspicious number associated with success. In Hebrew, the word of life has a value of eighteen. It's also a composite number in mathematics, totaling the addition of it's divisors. But, most importantly, it's the latest release from FileMaker! I don't have eighteen different things to cover, just the stuff I find most important which includes scripting, calculations and relationships. I'll do a brief overview of most of the new features but I'll focus on only what you can do with FileMaker Pro Advanced.

FileMaker Eighteen

FileMaker Server
Probably the most significant feature added to FileMaker Server 18 is Startup Restoration. The basic idea is FileMaker Server 18 logs any changes to a database in real time. All changes are tracked including data and schema. If your solution unexpectedly shuts down, FileMaker Server uses this log to "recover" your solution. I quote the word "recover" because it doesn't necessarily mean your file is damaged. If you've ever restarted a solution that crashed, the consistency check can take a long time to go through your file(s), but doesn't try to fix your file if there are any problems. In other words, the consistency check just detects issues while Startup Restoration attempts to return the file to a consistent state as if the database had been shut down gracefully.

Startup Restoration may restore data that would have normally been lost in previous versions of FileMaker. It's also possible, it may restore a portion of an action such as a Replace Field Contents or a Delete All Records. It's main objective is to get your file open and working again as quickly as possible so it's still possible to lose data or schema. In addition, there's no guarantee you won't have to recover a file or revert to a backup, it just should be less common. And, the best thing about this restoration process is it's completely transparent and will automatically occur each time FileMaker Server is restarted after unexpectedly quitting.

There's a handy white paper regarding Startup Restoration so I won't go into excruciating detail about this feature. However, here's a quote from the white paper I find sums up the purpose of startup restoration:

"Its objective is to ensure any data file corruption caused by an unexpected close are fixed by returning the FileMaker file back to a consistent state. This state is then used to automatically "recover" the FileMaker file once FileMaker Server restarts as a quicker and more reliable method than the legacy methods outlined at the end of this document."

NOTE: By "legacy methods", the quote is referring to backups and traditional recovery.

If you are familiar with audit logs, Startup Restoration is not so different. It takes a snapshot of the state of a field, record, table, layout, etc. before and after a change is made. If a crash occurs, that log is simply used to rebuild the file to a working state from the point of the crash. As you may have guessed, this log can take some processing time so FileMaker Server now supports multiple processors. Even so, long processes like imports can be slowed by Startup Restoration so it can be turned off when needed.

There are some other changes to the Admin Console such as new status icons, changes to schedules and some other minor enhancements. I won't get into these other features but you can read about them in the FileMaker Server 18 online help (Just click on the New Features link). There's also a new Spanish version of the Admin Console, updates to the Data API enhancements, Admin API standardization and support for Zabbix for server monitoring. Zabbix support is worth a look as it will change the way developers interface with FileMaker Server, providing real-time statistics with graphs galore.

FileMaker Eighteen

FileMaker Pro Advanced & Go
Now for what I'm really excited to talk about, FileMaker Pro Advanced (with some FileMaker Go mentions). I'll start off by talking about miscellaneous features that have a lot of bang for the buck but don't require much discussion. At the end of the article, I'll talk about features with depth like the While function, script error logging, file based script steps, security, importing and file version comparison. In addition to my pontificating, there will be videos and examples to boot!

Nudging
One of my favorite new FileMaker 18 features is something I've been waiting for a long time! Back in the 80s, I used a page layout program called PageMaker on a Mac Plus. You could move objects one pixel at a time with the arrow keys but you could also hold down a modifier key and move them ten pixels at a time. Yeah, I get it, why not just grab the mouse. The thing is, the mouse has the potential to move the object vertically and horizontally and is not very accurate. Sometimes you just want to nudge an object in on direction but faster than one point at a time. Now all you have to do is hold down the Shift key while typing the up, down, left or right right arrow keys.

Shift + Left, Right, Up or Down Arrow

Append PDF
We've had the ability to stitch PDF documents together for years in FileMaker Pro Advanced. Now that ability comes to FileMaker Go! This is a big deal since I treat desktop and on the go solutions more alike than any other deployment method. Sure, there are differences but it's mostly window and object sizes. Now I can offer the same appending PDF abilities on FileMaker Go instead of telling my client it doesn't work. Or, worse yet, trying to piece together some of the crazy workaround I've seen on the forums.

Shhh
FileMaker, Inc. has quietly restored the Photoshop image format so you can import Photoshop pictures without first exporting to another format. Never imported a Photoshop image but I guess enough people complained.

Data Migration Tool
There's a new version of the Data Migration tool so make sure you update that subscription to FDS (FileMaker Developer Subscription)! For 99 bucks you get the FileMaker Training Series, pre-release software, the iOS SDK and the Data Migration Tool. Who cares about that other stuff! The Data Migration Tool is the bomb, allowing you to transfer all your data from a file to a clone. No more scripts to perform the imports. You just need one line of code and your entire backup is placed in your new version of the file. So, what's new in the migration tool you ask? There are some minor bug fixes for container fields and indexes. Not much of a change but you still should have this invaluable tool on your tool belt.

If you aren't familiar with the Data Migration Tool, look at my article on FileMaker 17 new features titled Seventeen is Prime.

Specify Version
FileMaker 18 still has the same file format (.fmp12) but now you can specify a version of FileMaker in a FileMaker URL using the new "fmp18:" Internet Protocol (IP). The "fmp:" protocol is still available and executes the same internally as the new "fmp18:" protocol but you have the added ability to say I want this URL to open .fmp12 formatted files in FileMaker Pro Advanced 18 only. In future versions of FileMaker, the version suffix will be incremented.

fmp://databasepros.com/MyFile.fmp12

fmp18://databasepros.com/MyFile.fmp12


NOTE: The FileMaker 18 installer is required under Windows to install the new protocol handler. MacOS and iOS do not require the installer as the system registers are adjusted automatically.

Barcodes
You'll either be wildly excited by this addition or skip to the next section. FileMaker Go supports new barcode types: PDF417, ITF-14, Aztec, and Data Matrix. Data Matrix is widely used in pharmaceutical packaging. PDF417 is important in the transport business as well as inventory management and identification cards. Aztec barcodes were selected by the airline industry for electronic boarding passes as well as the rail industry. These new barcodes were added to iOS so it was natural to add them to FileMaker Go.

In addition, several barcode types that were recognized using ZBar are now iOS native to better conform to Apple standards: Code 39, Code 93, Code 128, Interleaved 2 of 5 and UPC-E. They won't function any differently from previous versions of FileMaker Go but an open source third party technology will no longer be needed, making FileMaker Go less prone to breaking.

Insert from URL
The SMB and LDAP(S) protocols have been added to the list of support protocols for the Insert From URL script step. The full published list is now: http, https, ftp, ftps, file, ldap, ldaps, and smb. The deprecated but still functional httppost and httpspost will remain unpublished. Any protocol not in the above list will be explicitly rejected before even passing it to the underlying cURL code. The error returned is the same error when the url is empty: error number 5, "Command is invalid".

Snapshot Link
The order of the file paths for the Snapshot Link feature searches have been changed to increase efficiency for local paths. Based on customer feedback, users were waiting for network paths to timeout before the local paths would be searched. Now, all local paths are searched prior to network paths. Since local paths are fast to search, the most common use of the Snapshot Link feature for network paths shouldn't be effected.

Opening App at Launch
First they were "files", then they were "solutions" and now they are "apps". Whatever you call those files you make with FileMaker, you can now have them open when the FileMaker program is launched. No more launcher files or training on how to open a remote FileMaker file. Hooray!

I absolutely love this feature except for how it's implemented. The only way to have a FileMaker file open on launch is for it to be set as a flag in the assisted install text. Most of my clients already have FileMaker so I'm not going to go around uninstalling and installing FileMaker just to make it easier for them to open my solution. Wish they had devoted the time to adding a preference item so I could setup it up after the fact. When they do add a preference option, (and, I'm sure they will) I hope they also include the ability to turn off the addition of the housekeeping fields each time I create a table without having to create a file and place it a directory on the local hard drive. The reasoning is simple, whenever I visit a client or use someone else's computer, I have to create this file rather than just checking a preference.



Security
Here's a tiny little feature change that's going to get me to upgrade to FileMaker 18. I'm sure we've all cursed the authentication dialog that appears as we enter and exit Manage Security. Sometimes you just want to make one small change and because you are using good password practices, it takes up a minute or two of your life to enter that complicated password twice. And, I'm sure I'll make a mistake and be back in Manage Security several times before I'm done. I know Steven Blackwell would say otherwise but this level of security is really not necessary. God bless Steven's devotion to security but thank goodness he couldn't change the mind of FMI. In FileMaker 18, there are no prompts for authentication when entering or exiting Manage Security as long as you are currently logged on with full access credentials. Thank you FileMaker Gods!

There are other changes to security such as the default to "require full access privileges to use references to this file" for all new files created in FileMaker 18. Existing files or files created in another version of FileMaker will not automatically default to requiring authentication before they can be accessed. In addition, a reference to the current file (itself) will be added automatically to the list of authorized files to allow for self-referencing such as when a same file import is done from one table to another.

FileMaker Eighteen

FYI: Clones and copies of files will automatically retain file authorization to the original file but exporting to FileMaker format will turn off secure file referencing.

A lot of FBA members (FileMaker Business Alliance) are standing up and applauding another new new security feature that allows users without full access privileges to control access to a file. That means they can't get into Layout mode, the Script Workspace or Manage Database but they can add accounts or change accounts.

FileMaker Eighteen

Don't be alarmed! Accounts with this option checked cannot create, delete or modify privilege sets, assign full access ([Full Access]) to any account or modify full access accounts or privilege sets in any way. All they can do is create new non-full access accounts and change existing non full access privilege set assignments. If you've ever managed a FileMaker solution for the same client for over a year, you'll understand how helpful this feature is. I have a client who emails me once a week to add and disable accounts. Now I can have them do the work!

NOTE: Allowing users to manage access to a FileMaker file should cut down on erstaz security systems.

Last but not least, the UI for Manage Security has been overhauled again to provide a better experience. Mostly what's been done is a merger of the basic and detailed view into a single screen. If FMI told me this is what they were planning on doing, I would have been skeptical. But, I think they pulled it off. When you first open Manage Security, you see the following dialog.

FileMaker Eighteen

The new dialog looks very similar to the previous basic setup but don't be fooled. It's received an overhaul allowing for authentication order to be more obvious by numbering the accounts. There's also a pane that appears at the right side of the dialog when an account is clicked, allowing changes to the account without opening a new window. In fact, you can even change a privilege set right inside the list view without going to the pane. Even cooler, you can select multiple accounts and change the privilege set in one fell swoop! Very nicely designed, especially if you plan on letting FileMaker neophytes manage access to a file. It has to be easy!

The design has also been modernized to match the changes that have been occurring to the interface over the last couple of builds. In other words, it's prettier. If you're the developer and want to create a new privilege set or fiddle with file access, simply click on the Advanced Settings button and the following dialog will appear.

FileMaker Eighteen

Unfortunately, this is the same old dialog from before and doesn't match the modern UI design of the first security dialog. I guess you can't have everything or they'd have nothing to include in the next version of FileMaker, LOL.



If you want more information on the new security features in FileMaker 18, I would recommend checking out the white paper by renowned security export Steven Blackwell.

File Comparison
The Save a Copy as XML feature has the greatest potential for future versions of FileMaker. It's very similar to the existing DDR (Database Design Report) and should eventually replace it. For now, it's being billed as a way to document your solution as well as a method for comparing two versions of a solution in order to identify the differences. It basically creates a full XML representation of a FileMaker file including tables, fields, layouts and well, everything.

I personally used this new feature and was able to use the compare feature in BBEdit to easily and quickly identify the addition of a new field. There are tons of third party products on the market that will compare two XML documents and I'm absolutely positive there will be a couple of FileMaker specific tools that take advantage of this new XML metadata, soon after FileMaker 18 ships. I can even imagine this XML output being used to rebuild a FileMaker file sometime in the future.

But, wait! There's more!!! In about thirty minutes, I was able to create a simple FileMaker tool that shows any new schema that was added to a new version of a FileMaker file. I used some XSLT that was designed for the DDR but it worked great for the Save as XML feature. I can't give away the XSLT code so it's locked away in the example file included with this article but feel free to use the locked example file to your heart's content. It only stores one comparison so hold out for more full featured tools that will likely be released later this year.



The Brand Spankin' New Import Dialog
For years, FileMaker developers have been chomping at the bit for a redesigned Specify Import Order dialog. If you've ever tried to match fields from two different files, it can be a horrendous job, especially if there are more fields than fit in the dialog. It's like looking through a telephone book for the person you want to call. If you're to young to remember the white pages, it's this gigantic waste of trees that has so many nine point phone numbers, you can go blind staring at it for more than a couple minutes. That's my analogy for the old field mapping dialog. But, you need to multiply the frustration tenfold cause you have to find every field and drag it to where you need it. Then, the field that was in the new location is swapped to the previous location of the new field. Most likely, you also wanted that field as a target so you repeat the same steps with the same frustration.

FileMaker, Inc. has solved this problem by eliminating drag & drop in the field mapping dialog. Now when you click on a field, you get a nifty little filter dialog where you can type in the field name and select the field you want. The dialog even highlights fields, with a special icon, that are already mapped. Very helpful! There's even a Manage Database icon so you can add a field quickly without leaving the filter dialog. Clearly, there's been a lot of thought and testing about how developers work on databases. The filter even divides fields into two groups: fields that can be imported and those that cannot. FMI could have just excluded all non-importable fields but I think it's more helpful if they are listed at the end of the list in case you are looking for a field but didn't realize you couldn't import into it.

FileMaker Eighteen

Just the new method for matching source and target fields would have been enough to satisfy my frustration with the dialog. But, I'm still glad FMI revamped the entire dialog. One feature that will really help advanced developers is the ability to turn off auto-enter options at the field level (look at the orange cogs next to fields in the screen shot above). You can still turn auto-enter completely on or off but the granularity of field level settings will eliminate the need for double imports. The first import is an add with auto-enter on to get some fields to auto-enter. The second import is a replace for the just the fields you don't want to auto-enter. With a large import, this can hold you up for additional hours you don't really have.

I also really like the the data pane that's locked at the left side of the dialog. In other words, when you cycle through the records to see the data, you can still see the source and target fields. I can't describe how many times over the years I've had to navigate far into the data, only to have to navigate back to the beginning to see the source fields. That's a lot of clicks since the import dialog hasn't been redesigned for over twenty years. Yikes!

Other features have less of an impact but are still welcome! The entire look and feel of the dialog has been updated to include a nice splash of color to draw your eyes to import features like the type of import (add, update and replace), green to specify an import field, orange cogs for fields that have auto-enter features, blue for match fields for an update import and red for fields that can't be imported. There's even an icon representing the type of file at the top of the dialog. When you're importing an Excel file, it allows you to specify which rows to exclude and which one to use as the field names (instead of just the first row). It's not earth shattering technology but it does prevent the need for creating scripts to delete records you didn't need imported.

The import dialogs have also been combined into a single dialog. No need to specify auto-enter and repeating field options in a separate second dialog. I mean, isn't this just laziness on the part of FMI. They wanted to add a new feature but instead of redesigning the dialog, they just added a second dialog that more times than not confuses new users. Thanks for correcting this UI issue! Now all the optional features are neatly located at the bottom of the dialog with a nice show/hide arrow so you can better utilize the import dialog screen real estate on those big import jobs.

Yes, I'm still talking about the import dialog. Like I said, they completely rethought this feature. Next on my list is custom separators. I don't come across strange separators as much anymore unless I'm working on a government account but it does come in handy from time to time. You can specify a custom import order in the first import dialog that asks you to locate the file you want to import or the field mapping dialog that comes up next. Your choice! Semi-colon and space separated are available from a popup menu, since they are pretty common, but you can specify any character as a separator. I'm guessing someone is going to find a cool solution for this new feature that has nothing to do with straight imports. Just my guess.

Well, that's about it. Just a few things to mention at the end of this section. First off, the new dialog isn't supported in FileMaker Go or WebDirect unless it's been scripted. Hopefully next upgrade? Another small detail so you aren't surprised. The popover for the import type (add, update or replace) will appear the first time you try to import. I guess it's a new user helper since it's not clear you can change from "add" to another choice. The popover will reset each time you quit FileMaker and try to do another import. Do I hear preference item to turn this off for us developers who don't need to see it? Pretty please with sugar on top.



The New Loop on the Block
The new While function does nothing different than the existing recursion found in custom functions. It's also closely related to a Loop/End Loop script step combo. What's different is how it loops, not the end result. Some people are going to complain that this feature isn't very helpful. But, that's one of the greatest things about FileMaker. I like having different tools to accomplish a job. No matter how similar a group of tools are, they have small differences that make them shine in unique situations. So, let's examine what the While function has to offer. Let's start with the anatomy.

While([initialVariable]; condition; [logic]; result)

It looks a lot like the Let function with the declaration of variables in the first parameter. Square brackets indicate multiple variables can be declared if needed. The next parameter is the condition or boolean statement. While the condition is true, the function will continue to loop the third parameter titled "logic". This can also have multiple variables and usually increments, decrements or changes the variables in some way to allow the condition to eventually exit the loop or the result to be accumulate changes from the looping logic. For example, the logic section could increment or decrement a counter as well as append or prepend values into a single variable to prepare it for the last parameter. The final parameter called result is again very similar to the Let function. When the logic fails and the While stops looping, the result is returned as the final value for the formula.

No amount of theory is going to really help you understand this new function so here's an example of the very common task of creating a multi-key from the contents of a field. This multi-key could be used to filter a relationship with a type-ahead like feature. If the field contains "Database Pros" the result will look like the following:

Database Pros
Database Pro
Database Pr
Database P
Database
Database
Databas
Databa
Datab
Data
Dat
Da
D


The While function can accomplish this task using the following formula:

While(

[@Data = company;
@Length = Length(@Data);
@Result = ""];

@Length >= 0;

[@Length = @Length - 1;
@Result = @Result & Case(@Length > 0; "¶") & Left(@Data; @Length)];

@Data & @Result

)


FYI: There are lots of developer conventions for Let variables, and now While, but I like to use the at sign (@). Not only does it prevent variable names from overriding functions, it also makes it easy to identify your variables inside the code.

All variables must be declared in the first parameter if they are to be referenced in the rest of the formula. I've noticed some exceptions but they really aren't worth noting. It's best just to declare the initial value for every variable in the first parameter to be safe. In this example, the data and the length of the data being massaged are declared so they can be used in the logic parameter to determine. The result variable is declared as a blank value just so it can also be used in the rest of the formula. As you work with the While function, I think you'll find you use a lot of empty declarations.

The second parameter tests whether the length is greater than zero or not. It keeps looping the third parameter until the boolean test is false. The third parameter or loop is where the length variable gets decremented, like a counter, by removing a value of one (1) each time the loop iterates. The result is also built-up using the append technique by referring to itself in the formula. The formula takes the current value in the result and adds onto it the left values based on the length. Each time the loop occurs, one (1) less letter from the data is added onto the return-separated list until the data has been exhausted.

FYI: The append and prepend techniques are methods for preserving the contents of a variable and adding on to it. It can can be used with Set Field or Set Variable and simply requires a reference to the target field in the formula in order to preserve the original data.

The fourth parameter concatenates the full company name to the result variable to avoid an extra return at the beginning of the multi-key. The extra return wouldn't stop the multi-key from functioning properly. I just like things neat and clean. You could make the formula function properly by removing the equal sign from the logic and removing the company name reference in the result. Try it out but you'll get that ugly extra return.

For comparison, here's the same formula in a custom function using recursion:

Case(

Length(Text) > 1;

Text & "¶" & MultiKey(Left(Text; Length(Text) - 1));

Text

)


The custom function can be called with the following calculation formula:

MultiKey(company)

At first glance, the recursion in the custom function seems easier. In fact, it was easier for me to write the recursive custom function but I've been doing it for years now. It's clear the While function requires a lot more code to accomplish the same task but it's also much more straightforward. In it's verbosity, the While function breaks everything up into four parameters that make it clear how to program a loop. It also follows standard coding parameters that are consistent across programming platforms. This is important because standards are there for a reason, making it easier for anyone from another platform to use this tried and true methodology.

I also did some simple single-user speed tests that are included in the example files that come with this article. I've heard some grumbling about the speed of the While function on the forums but I haven't found it significantly slower than custom function recursion in my testing. I ran the formula shown above 50,000 times and the While function took 13 seconds versus 12 seconds for the recursion. Granted, I only tested in a single-user deployment but I'd be surprised if there was any relative difference between the two approaches in a multi-user scenario.

Now, I'm not a JSON kinda guy but I do read the ETS (Early Test Site) forums and folks are foaming at the mouth for the While function, stating it will make parsing JSON far easier. I'll have to take their word for it. I have provided an example of JSON parsing in a scenario demonstrated in the FileMaker 18 webinars. Where I've focused my testing is in jobs I would normally use looping scripts or recursion. I have included three other example files in addition to the multi-key explosion above. These include adaptive phone formatting for any length phone number, random password generation and email extraction. My conclusion after creating these example files is that the While function doesn't do anything new, it just offers a different approach. Each of the example files contains notes so refer to them for my findings.



It's also important to note that the number of recursions for standard custom function recursion has been increased to 50,000 iterations. This increase applies to the While function as well. There's also a new SetRecursion function that can increase or decrease this maximum.

FYI: Previous to FileMaker 18, the only way to surpass 10,000 recursions in a custom function was to use tail-recursion. Since FileMaker allows for five separate recursive calls, tail-recursion combines those calls into a single maximum of 50,000.

Data I/O
There are a total of eleven new Data File script steps in FileMaker 18. There's also a new function called Get(OpenDatFileInfo) that's designed to work along side these new script steps. That's quite a bit of work for the development team so I hope this feature is worth it. I have my doubts but I'd be glad to be proven wrong. Here's a list of the new script steps:
  1. Close Data File
  2. Create Data File
  3. Delete File
  4. Get Data File Position
  5. Get File Exists
  6. Get File Size
  7. Open Data File
  8. Read from Data File
  9. Rename File
  10. Set Data File Position
  11. Write to Data File
I can only remember one project where I needed to manipulate files stored on the hard drive. I used the incredible Troi File plug-in for this task. That was over ten years ago and I've never had the need to manipulate files in the operating system since. Maybe I'm unique and I'm definitely a FileMaker purist. If it can't be done with FileMaker alone, sometimes it's not worth it. Too many opportunities for third party communication to break down with updates and companies going out of business. If I keep it all in FileMaker, I have less chance of breaking a solution.

With that said, I do believe there are sometimes when OS manipulation is needed. I know a lot of people have asked for this feature so I thought long and hard on how to use it. My first thought was for preferences. Currently, I use a one record table and ExecuteSQL to grab the settings for the current user. It works great and all I need is a simple script call to access a preference for a specific user. Naturally, I was thinking I could store a text file on each users computer with their selected preferences. The only problem is, I still need a FileMaker interface for the user to interact with the preferences so why not just store it in FileMaker records and fields. This doesn't even consider the fact that text files aren't object oriented so the data needs to be parsed and then written to a specific location in the external text file. Not nearly as easy as just letting the user select their settings from fields with popup menus on them and just storing the data in FileMaker. This also allows the preferences to move with the FileMaker file.

Then I thought about data I export from FileMaker and it came to me that I could make changes to comma and tab separated files like adding custom header information. Now I'm starting to like this feature. In the past, I’ve done some crazy things to get custom headers on a file including making a fake record containing the names of the fields and looping through the records to accumulate the data in a global and then exporting with Export Field Contents script step. I gotta tell you, it was a lot easier to use the Open Data File, Read from Data File and Write to Data File script steps to add custom field headers to a file. Here's the simple script I wrote:

FileMaker Eighteen

The first thing I do in the script is specify my paths and then do a standard export to a tab-separated file. Then, I open the exported file using the Open Data File script step and it automatically assigns the file an ID using a variable of my specification. This file ID is used to identify the file when it is being read, written or closed. Once the file is open, I can read the file into a variable. I need to read the file into memory so I can use robust FileMaker formulas to concatenate the field headers to the beginning of the exported text. Otherwise, my only choice is to write over existing text. Once I've concatenated the field headers and the exported data, I set the file position using the Set Data Position step so the data overwrites from the beginning rather than adding it to the end. Finally, I can write the data back to the file and close it. You'll also find this script in the example files that comes with this article.

TIP: It's important to understand that you can write directly to a file but it will overwrite existing data or place the new data at the end. You can specify the data file position and write over a particular segment but I think most people will read the data from a file into a variable, manipulate it with FileMaker functions and then write over the entire file.

There are some other script steps that could assist in the manipulation of documents on the local hard drive of users. I can see the Delete File script step being used a lot to remove data from the hard drive when it is no longer needed. The files don't even need to be created by a Data File script step. You just need to know where the file is so you can pass the path to the Delete File script step. Think of it as an alternative to storing data in the temporary path directory. And, don't forget the Get(OpenDatFileInfo) function I mentioned at the beginning of this section. If you forget to close a data file, a script might fail to open it at a later time. This handy function can tell you what files are open so you can close them.

FYI: Open data files will automatically be closed when FileMaker is quit or exited.

One thing I miss from the Troi File plug-in is the ability to search the local hard drive for a file. This comes in really handy if you need to find out what files are in a particular folder so you know what to target with your Data File script steps. I also like the ability to just create a folder anywhere you want on the hard drive. Keeps things nice and neat. Hopefully FMI expands the abilities of these Data File script steps based on customer feedback but only time will tell. They may not want to steal too much from the plug-in manufacturers out there.

Script Error Logging
How many times have you asked a user how to reproduce an error and they can’t. I personally can't count the number of times. Now you can just turn on the fancy dandy script error logging and see for yourself. If the user remembers the button they clicked then just search for that script name. If the user can remember when the error occurred then searching the timestamp should allow you to locate script trigger issues or possibly other errors that might have occurred with other scripts that ran before or after. It's really going to make troubleshooting so much easier!

FileMaker Eighteen

Data included is a timestamp, the session number, the file name, the account name, the script name and index, the step name and line number, the error code and custom debugging information. The session number will be @1 when running the script error logging locally since there's only one session. The script name as well as the index number are provided. The index is a fancy word for the order of the scripts in the pane. The custom debugging information will be blank unless you setup a calculation to grab information from the database. I'm guessing common formulas will simply reference primary or foreign keys in order to identify the record. Layout names might also be helpful to identify the context where the script error occurred.

To locate the log file, look in the users Documents folder for a file called "ScriptErrors.log". Open the log in any word processor, spreadsheet or even FileMaker. Included in the example files that come with this article is a simple database that imports the "ScriptErrors.log" file. Enjoy!



Deprecation, Removal & EOL
The most shocking deprecation notice is peer-to-peer sharing. This is when you use FileMaker Pro Advanced as the host instead of FileMaker Server. It's limited to five connections but is a great solution for really small companies who can't afford FileMaker Server. But, once you start thinking about it, peer-to-peer sharing is not a good choice when you consider backups. To properly backup a file hosted by FileMaker Pro Advanced, without corrupting it, you have to manually close the file, make the backup and launch it again. This usually leads to backups not being made whereas FileMaker Server makes it so easy with it's automated backups. While you may not need the extra robustness of FileMaker Server, backups can be a life saver.

Peer-to-peer sharing isn't being removed, just not being developed any further. It can still be used for testing, which I do all the time. It's just not recommended for small workgroups. Too many people setup peer-to-peer sharing incorrectly without a dedicated server, leading to file corruption (often placing the FileMaker file on a file server). In the long term, purchasing FileMaker Server doesn't really add that much to a site license and can actually save you money by avoiding data loss. Add to that all the other great features in FileMaker Server and it's a no-brainer. Besides, does anyone even use peer-to-peer sharing in a production environment anymore? I don't currently have any clients without FileMaker Server. No big loss IMHO.

The Swedish people must be up in arms since the Swedish version of FileMaker Server has been discontinued and replaced with a Spanish version. Seems like a good move to me. There's a lot more Spanish speaking people in the world than Swedes. Sorry, just the facts.

Support for macOS Sierra 10.12 has been removed, as you will see in the technical specifications below. That doesn't mean FileMaker 18 won't work with 10.12, you're just out of luck if you call FileMaker technical support.

Last but not least, the end of life for FileMaker 15 is September 20th, 2019. Let's all bow our heads in solemn respect. After the 20th, FileMaker will no longer support the product. You can still use it but you can get installers or technical support from FMI. Expect the same to happen to FileMaker 16 in the next couple of years.

In the ongoing watch on previously deprecated features, the runtime SDK is still alive and kicking. It's been four years and four versions of FileMaker since the demise of the runtime engine was announced. It seems like it will never disappear from the FileMaker product line. I think the only thing that will kill it off will be a file format change. Same with the PHP and XSLT API. While these two technologies are being replaced by the Data API and JSON, they probably won't completely die till there's a file format change. The last file format change was from .fp7 to .fmp12 seven long years ago. Eight years before that the .fp7 file format was introduced. Based on the elapsed time since a file format change, I feel these technologies are close to arriving on the chopping block.

Technical Specifications

FileMaker Pro Advanced 18:
  • macOS High Sierra 10.13
  • macOS Mojave 10.14
  • Windows 10 Enterprise & Pro Editions (Fall Creators update)
  • Windows 8.1 Standard & Pro Editions (with update)
  • Windows SP1 Professional & Ultimate Editions (with update)
FileMaker Server 18:
  • macOS High Sierra 10.13
  • macOS Mojave 10.14
  • Windows Server 2016 Datacenter (with Desktop Experience)
  • Windows Server 2016 Standard Edition (with Desktop Experience)
  • Windows Server 2012 R2 Standard Edition (with update)
FileMaker Go 18:
  • iOS 12.2 minimum
FileMaker WebDirect 18:
  • Safari 12.x
  • Internet Explorer 11
  • Microsoft Edge 44
  • Chrome 72
Conclusion
It's amazing how much the FileMaker development team can accomplish in a single year. While there's bound to be grumbling in the FileMaker community about FileMaker 18 being lackluster, I find the redesign of the import dialog, the file version comparison, the security changes, nudging and Startup Restoration to be very compelling reasons to upgrade. Not every feature is going to make every customer happy. Let me know in the comments section below what your favorites new features are and why. I'd love to hear your thoughts! You can even grumble a little if you want.

Download a free trial of FileMaker 18 and start your journey today!

FileMaker 18 Trial

Read the new features list in the FileMaker Pro 18 Advanced online help:

FileMaker 18 New Features

Author:
John Mark Osborne
jmo@filemakerpros.com
www.databasepros.com

Example File (available to patrons at $5.00 per month): Download here if you are a patron

This blog is completely free. Please support it by clicking on one of the advertisers at the left side of the window or becoming a patron. Thanks so much!

Comments:

Norman Winn 05/28/2019
  I've scanned several FM18 overviews that were either too specific or too shallow. Yours is comprehensive, readable and enjoyable. Thank you.
Response by:   John Mark Osborne 05/30/2019
Thanks for your kind words. They are much appreciated.
Davide Puppo 05/24/2019
  Opening App at Launch:

I searched the place where the AI_LAUNCH_CUSTOMAPP value is stored but with no luck.

If we could find it we could think to use the new datafile script steps to modify with the startup script (for example)
Response by:   John Mark Osborne 05/30/2019
I like your idea but unfortunately, you have to install FileMaker 18 first before you can use the new Data File script steps.
Beverly Voth 05/22/2019
  This is very good. Loaded with so much, it could have been a series of articles! LOL - love the 'hint at XSLT'. Hopefully they've worked out all the XML in the DDR to be accurate (it looks like they did - AFAICS).
Steve Bogin 05/22/2019
  Link to FM 18 goes to FM 17
Response by:   John Mark Osborne 05/22/2019
Thanks for the alert. I have fixed the link for the trial download.

Add Comment:

First Name: *
Last Name:
Email: *
Web Site:
Comment: *
 Email Addresses will not be shared on the web site!