When you delete a field that calculations or scripts depend on, FileMaker provides great warnings.
FileMaker is not so graceful about providing similar warnings when deleting scripts. It’s usually impractical to know the potential consequences of deleting a script without a solution analysis tool like InspectorPro. It might be easy for you to remember the connections in a solution you just started solo work on, but it’s a completely different matter when it comes to a legacy solution that has been around for years (or days, for some of us!), or a solution with several developers each working on different interdependent components. It’s impossible to remember all the references to any particular script, even if you created all of them. InspectorPro tracks all this information for you with great level of detail so you can maintain solutions with confidence that your actions will not have any unintended consequences.
I started with the Contacts starter file and generated a Database Design Report (DDR) from FileMaker Pro Advanced, formatted as XML. Next, I imported it into Inspector Pro and found that no problems were detected. Nice!
Let’s first look at all the places where a script could be referenced.
Buttons, custom menus, and other scripts can reference other scripts with any of:
- Perform Script
- Perform Script on Server
- Install OnTimer
Scripts can be referenced by calling any of the file option script triggers:
Scripts can be referenced by layout script triggers:
Scripts can be referenced by layout object script triggers:
Scripts can be called by other methods like…
- XML and PHP APIs for Custom Web Publishing
- Server-side schedules
- fmp URLs
We won’t be discussing these three right now because FileMaker’s DDR doesn’t include any information about these references. We are considering how to incorporate these in the future.
Again, it’s very easy to create problems. For this example, I created scripts and attached them to all the areas listed above. I then went back to my list of new scripts and deleted them. I didn’t see a single warning dialog telling me that the script I was about to delete was in use. The only dialog we get is confirming the deletion, and you can even bypass this dialog if you hold a modifier key while you click the delete button.
POOF! The script is gone, and this is just the beginning of your problems!
After I removed all of my scripts, I generated another DDR and imported it into InspectorPro. It found all the problems. Right from the analysis row, InspectorPro will show you how many problems it auto-detected.
This report is for your entire analysis. It is grouped by database and area. You’ll see what item and parent it found the problem in. Note the level of detail about the problem it found. Not only does InspectorPro show that the script is missing, but it also displays the type of missing script, and, for script triggers, the mode it was enabled for.
Again, you can also drill back into your solution using this window. Suppose you wanted to look at the second-to-last problem where you have a script that references another script by calling Perform Script on Server. Click on that row, and you are immediately looking at all the steps in that script with the script step that has the problem automatically selected. Awesome!
Using the Problems window is one way to drill-in to your problems. InspectorPro also shows you where problems exist when you are looking at broader views of a solution. You can look at all of the scripts in the solution in the Scripts view window. You’ll see a warning triangle next to the number of steps for that script. This warning triangle tells you that some of your steps have problems.
The starter solution is a small solution, comparatively speaking. In many real-world solutions, there can be hundreds or thousands of scripts. Using the problems window is a great way to find all the problems. But one of the more powerful features of InspectorPro is data visualizations. The Script Universe in InspectorPro 5 has undergone some really nice refinements. But what I want to point out is that you can gain the insight of where your problems are in the Script Universe from any of the referenced items, something that is not possible currently even with the list view of your scripts. Not to mention that there are also physical constraints in seeing hundreds if not thousands of scripts. But with the script universe you see them all and the red dots indicate where your problems are.
Again, that is the fairly simple starter solution, so let’s look at one of our production solutions that has spotted 3 problems. This solution has 231 scripts and notice how easy it is to spot where your problems are.
That’s all I will cover for now. We’ll be covering more details on how to analyze and improve your FileMaker Platform solutions in future blog posts.
If you want to learn more about InspectorPro, please check out the website and feel free to download the software for a free trial.