FileMakerSoliant TV

FileMaker 17: Customizing Default Fields

By May 15, 2018 May 7th, 2019 8 Comments

With the release of FileMaker 17 comes a variety of new features and capabilities for both users and developers. Learn about how to customize and leverage new default fields in your solution here.

Video Transcription:

Hi. My name is Dawn Heady. I’m a Senior Technical Solution Architect with Soliant Consulting.

In my last video, Introduction to Default Fields, I demonstrated this new feature of FileMaker Pro 17 Advanced and I, also, showed how to basically disable it. In this video, I want to show how you can leverage this great new feature, Default Fields to create fields that match your own naming standards or perhaps the naming standards of the particular project you’re working on. Let’s get started.

We’re going to look at the package, so I’m going to quit FileMaker. Here is my folder where FileMaker Pro Advanced is, inside my Applications folder. I’m going to right-click on it and select on my Mac “Show Package Contents.” The FileMaker application itself is made up a lot of different files.

Inside are the contents of its package. One of those folders is called “Resources.” Resources has all kinds of things in it. It has lots of icons, and all kinds of stuff, DefaultGlyphs, etc. In this case, yours is probably sorted by name, but I’m going to sort it by “Kind,” just to make it a little bit easier to find this. I want all the folders to sort together here that are inside that “Resources” folder.

What you’re going to look for, if you’re an English speaker like I am, the “en.lproj.” This means it’s the English version. Below, these would be the Spanish, French, Italian, and all the down are the language files.

Inside that folder is the DefaultFields file. You don’t want to modify this while it’s inside the package. What you can do is, hold down the option key and drag it out to my desktop. I’m going to replace that blank one that I made. Now, I have FileMaker’s example.

We can open it here and look at it. It’s a big .xml file. Don’t be scared of this. It’s just .xml. It tells us that we’ve got five members, so that’s five fields. Everywhere one of these fields texts starts, that’s the definition of a new field. These are the five fields that FileMaker makes.

I like those fields and the preferences; I just don’t like the name and don’t want “Primary Key.” Let’s say that our standards are to just use User ID as the primary key. Notice here that I specified the Data type. This is where I specify the Auto-Enter calculation, which is inside this Get Data tag. Here is the Get UUID. That is what would be put inside. It is text that will be inside that calculation field.

We have all kinds of other things like “Validation=Always” and is “notEmpty=true” and “unique=true.” There are a lot of things we can define here in the fields. I’m going to try changing that, and then I’m going to save it. I’ll save that to my desktop and replace the other one. This is the blank one, and this is the one we just modified. Let’s move this to a new window.

I’ve already got a file here that I’ve saved with all of my Soliant Consulting preferences. I’ve changed the name on all five of those fields. I’m going to save a copy of this here in the Shared folder. In Shared, I’ve put the defaults that I would use for Soliant.

Let’s open back up Meetings. It’ll open up here in FileMaker Pro Advanced 17 and pull it up into place.

Now, let’s go to File > Manage > Database. Once again, I want to try to create that test table. This time, you’ll see that I still get the same five fields FileMaker creates for me, but now they are named to match our Soliant standards. The primary key is now called “ID.” I prefix my housekeeping fields with a “zz_.”

I want to show you one more thing. This is how I intend to use this feature. Sometimes, I have different standards for different clients. We follow their own naming convention. Or, you might have inherited an old file, so you’re following its naming convention.

My intention is to have some different defaults. In this case, I have one specific for a client who makes use of SyncServer Pro, and SyncServer Pro requires you to add four fields to every table that are specific for syncing. In this case, I think I’m going to replace the DefaultFields file in Shared. I’m going to get rid of this one. Instead, I’m going to add this one, where I’ve even added some other fields, to the Shared folder.

Let’s see what we get. I can actually take all three of these “Default” folders that I have prepared and just store them right inside the Shared folder. FileMaker will ignore them, but I have them handy. I can just replace my DefaultFields laying loose inside of Shared. I can replace that file whenever I switch which solution I’m working on, and perhaps it has some different standards. Let’s see what happens here.

Let’s go to File > Manage > Database. This time, I’m going to make a Test Table. Let’s see what we get. FileMaker has created a whole series of fields for me. By having various default files you can drag into place without even having to close FileMaker Pro Advanced 17, you can customize your work environment for your situation.

Well, I hope you enjoyed this video. Please tune into Soliant TV and check out the other videos about various new features in FileMaker Pro 17. Thanks so much for your time. Have a great day!

Dawn Heady

Dawn Heady

Dawn is a Senior Technical Solution Architect, designing and developing FileMaker solutions for large and small companies for more then twenty-five years. Though affiliated with our Chicago office, she generally works from her home just outside of Indianapolis, Indiana. Dawn is a FileMaker Trainer, frequent presenter at FileMaker DevCon, and co-author of the book "FileMaker 12 Developer's Reference: Functions, Scripts, Commands, and Grammars".

8 Comments

  • Avatar Kyle says:

    how do I change the “PrimaryKey” field from the UUID to a Serial number?

    • Dawn Heady Dawn Heady says:

      Kyle:
      Hi. That’s a good question. FMI has not published the xml specification for the DefaultFields.xml file. While it is similar to the xml FileMaker uses when a field is copied to the clipboard, it is not exactly the same. I’ve fiddled with it a bit, but not discerned the tags necessary to set the PrimaryKey field as an auto enter serial number. I will reply again if I get the answer.
      Thanks,
      Dawn

  • Avatar james deraps says:

    useless if you dont explain the stucture of the default fields file.

    • Dawn Heady Dawn Heady says:

      James:
      Thank you for your comment. We just posted a new version of the video that explains more about where to find FileMaker’s DefaultFields.xml and shows the xml. However, FMI has not published the xml specification for the DefaultFields.xml file. While it is similar to the xml FileMaker uses when a field is copied to the clipboard, it is not exactly the same.
      Thanks, Dawn

  • Avatar Bruce Herbach says:

    Dawn,

    This was helpful. I tried creating an XML design report and replacing the settings for the PrimaryKey with the setup for a Numeric Serial number. The result was the Data field was checked with out a value in the field. I was able to get a Number data type.

    It would be nice if they would publish the specs so we can expand what goes into this file.

    • Dawn Heady Dawn Heady says:

      Hi, Bruce. I had a similar experience. I suspect FMPA17 does not support all the field options. It would be nice to officially know what is currently supported. For now I am happy to be able to tweak the default fields FMPA17 creates.

  • Interesting. I would’ve thought the default field prefs would’ve resided within the FMP file, rather than in the installation. Basically these files need to be copied across machines if you have a multi-computer setup working on a shared file.

    • Dawn Heady says:

      Hi, Bryn. You are correct, the customized DefaultFields.xml file would have to be on each client machine.

Leave a Reply