English

Fundamentals: Knowing Context

Over one's development career, you'll come across a number of people who "think" they know how something really works. You then proceed to show them some of the cool things they can really do, like a "context jump" within FileMaker. You then smile at their surprise, because what they thought was possible isn't even the start of it.

If you don't even know about, or truly understand, FileMaker's ability to jump from one context to another, then you're missing a critical piece to the FileMaker puzzle. It's one of the ways you break down a complex solution into a more digestible division of smaller parts. This not only makes the Relationship Graph potentially more understandable, but may make your solution more performant.

There are, however, a few big issues you must address as your FileMaker solution becomes more and more complex. One of these is protecting your code against itself. Certain script steps like Delete Record, Delete All Records and Replace Field Contents can have severe consequences. Especially, if performed without confirmation. And even then, accidental clicks is certainly a thing! In order feel really comfortable about using these types of actions you can always "protect" your code from doing the wrong thing in the wrong place. This where you implement either Layout or Context specific checking. This can easily be done when you know how to use FileMaker's internal ID values.

Tags:

JSON Parameter Passing

Thank goodness JSON was implemented within FileMaker. Without it, we would still be using a variety of other methods for handling multiple parameters within a FileMaker script. Using JSON, we now get the double-sided benefit of 1) having an efficient serialization of key/value pairs as inbound parameters and 2) it just happens to be the standard which most of the rest of world is using for a large chunk of how things interoperate.

In this video, and the technique file, I'll showcase a few examples of how you can receive and work with inbound parameters when using JSON as the method for handling them. We discuss script results, clean-reading code and the final example provides a very useful custom function for the auto-instantiation of JSON-based script parameters into their FileMaker scripting counterparts.

Using the provided JSONVariables custom function is a great alternative to individually parsing all of the inbound parameters. It doesn't replace the need to initially declare your variables, but it does provide the opportunity to have cleaner reading self-documenting code. If you've not used JSON for handling your parameters before, then you should start right now and use this video and file as guidance!

Tags:
AttachmentSize
JSONParameterPassing.zip1.65 MB

10 Killer Utility Scripts

Once you've repeated the same thing within FileMaker more than a dozen times, you often realize you should really be using a Utility script. A utility script is something which allows you to focus more on the unique solution and less on the routine things you end up doing over and over again.

In this video we take a look at 10 killer utility scripts. These vary from a simple copy field routine to a very useful related record creation routine. Do you find yourself often needing to toggle values within number and text fields? Probably, and there are utility scripts for that!

Tags:
AttachmentSize
10KillerUtilityScripts.zip1.68 MB

The "One" REST Script

When it comes to programming, there's always more to learn and share. If you've worked with REST APIs in the past, then you may have already devised your perfect system. If not, then this video will showcase a freely available script which you might want to consider first before trying to solve the problem yourself.

In our ever expanding world of coding to standards and systems, many of which have existed for decades, it's always prudent to see if you can beg, borrow and... Ok, don't steal... code which already does the trick. When it comes to HTTP's REST implementation we've already got all the code necessary.

Thanks to a great community contribution by Todd Geist, you really don't need to fumble through all the variations and possibilities of HTTP's REST methods used by FileMaker's cURL features found within the Insert from URL step. Todd and company did the heavy lifting and made an open source file available to everyone.

In this video I showcase my own personal enhancements to the script and provide some insight into some of the ways I code and why I do the things the way I do.

Tags:

Adding Back Buttons

One of the most valuable features you can incorporate into your Claris/FileMaker solution is a back button. This feature is deeply ingrained in every individual who has ever used a web browser. It represents the common scenario where your mind recalls the previous location and seeks to return to it. However, the challenge lies in the complexity of your solution's navigation system. Without careful attention to simplifying navigation, there can be an overwhelming number of options that most people struggle to remember.

This video focuses on implementing a few relatively simple scripts which can greatly enhance the usability of your solutions. Providing end users with the ability to retrace their steps and easily return to their starting point is an invaluable offering. The beauty of this feature is that once it's integrated into your solution, it will seamlessly work. It will track and remember the desired state information without any additional effort. All you need to do is add it to your solution.

If you are building a complex system, which is the case for most solutions, incorporating a Back Button feature is an obvious choice that requires no second thought.

Tags:
AttachmentSize
InvoiceSolution-BackButton.zip3.49 MB

Better Script Writing

While learning to develop within any environment, it's common to develop habits which keep you within a consistent framework. However, occasionally looking outside of your current framework and observing how others accomplish similar tasks can be both affirming and instructive. You may discover valuable tips and tricks from other developers from which you can adapt to enhance your own practices.

This video focuses on script writing and explores various techniques employed by different developers, specifically regarding the documentation and structure of scripts. By examining multiple files and exploring different scripting methods, we can gather helpful insights. Additionally, I will present what I consider to be one of the best approaches to managing a complex script that utilizes multiple inputs and outputs.

The beauty of Claris/FileMaker is that you have the flexibility of keeping things simple or making them as complex as desired. Drawing from my decades of experience, this video offers numerous tips to improve your script writing skills. You're likely to find valuable insights that can elevate your approach to scripting.

Tags:
AttachmentSize
BetterScriptWriting.zip1.65 MB

10 Good Developer Habits & Scripts

Sometimes, it's those little suggestions or tricks which make for a more enjoyable and productive development environment. In this video, I cover some of what I consider to be the most helpful things for working within FileMaker - at least when it comes to scripts and good habits.

Hate having to scroll down your long list of scripts in order to target the one script you're working on? Use a Testing Code script. Working with more than one developer and need a good method of communicating what was done and when? Use some dedicated "dev" scripts. Need to open those lengthy API docs for that integration you're working on? Make a Docs script.

If there isn't some little tip or tidbit in this video that helps you become a better FileMaker developer then, congratulations, you've reached the level of Master FileMaker Developer!

Tags:
AttachmentSize
10GoodDeveloperHabits.zip1.65 MB

Execute FileMaker Data API

FileMaker Pro provides a variety of methods for extracting your data from its database. From memory, we have standard relationships and calculated concatenations, the Copy All Records script step, scripted data loops and using the ExecuteSQL function. In FileMaker 19, we're provided with yet one more method for pulling data out of the system. The Execute FileMaker Data API script step allows us to use what was formerly available only from outside of FileMaker Pro via a url.

Now, within our scripts, we can use this fast retrieval method for extracting data in the popular and common JSON format. Able to use that data in both web viewers and many other places within your solution. Knowing how to use this new script step will help you extract the data you need - when you need it.

By carefully crafting a specific layout, and using the Execute FileMaker Data API script step, you'll be able employ techniques such as Virtual List and using the data for presentation within Web Viewers. You can also simply pull the data for use within UI elements as simple as a button.

Let's take a tour of this relatively new feature and understand how we can use all of its numerous features.

Tags:
AttachmentSize
ExecuteFileMakerDataAPI.zip1.68 MB

Reusable Dialogs Revisit

Causing a user to make an explicit choice within your software really only happens from some sort of "locked-in" process. This process most typically happens within the form of a dialog box. It's the one roadblock you can stick in front of a user and expect input. Your software then uses that input to determine the output or direction.

While FileMaker Pro does have its own native dialog box, there are some limitations to the native Show Custom Dialog script step. The number one limitation is the lack of control with regards to size and positioning. Aside from that, the dialog box is pretty fixed in terms of how it looks and what it does.

Actually, the limitations on a dialog box are a good thing. It creates a sense of consistency across the whole notion of software itself. Users have seen dialog boxes and interacted with them. They know what they do and how to react to them. So, in order to gain a bit more control and flexibility, we use our own layouts to provide our own variation of a dialog box.

By using a FileMaker layout, we get to control how it looks and reacts to certain situations. This video and technique file revisits an early version which was released when Card Windows had just come out. If you enjoy using powerful and efficient methods of enforcing that "locked-in" process, then make sure to check this one out!

Tags:
UI
AttachmentSize
ReusableDialogsRevisit.zip1.6 MB

Learning to Master Looping

Without a fundamental understanding of some programming topics, it's often difficult to solve certain problems in the easiest possible fashion. In fact, one of the things I've enjoyed learning about programming is that more code isn't always better. Searching for the simple answer sometimes takes a bit more time. And, learning to solve the problem with less code is more enjoyable.

In this video, I walk through a simple process of massaging some data into a desired format. While the objective often seems simple, the solution isn't always obvious. Especially, if you haven't been programming for good amount of time. There's also those hidden tips or tricks which you don't really know about until you've invested the time into improving your craft.

I remember learning about writing loops in FileMaker and feeling the sense of power that comes with any type of data processing. To this day, most of programming comes down to looking for a pattern and then processing that pattern in some fashion. Usually, with a loop. As the seasons cycle and the fields wither and then return, such is the way of software. You find the pattern and process it with a loop.

Tags:

Pages