This controls if/when data is committed to the field or variable. Each button in the Show Custom Dialog options has a checkbox to Commit Data.A global variable can persist beyond the current script. A local variable’s scope is only within the current script. The variable that you specify can either be a local variable (prefixed by one dollar sign) or a global variable (prefixed by two dollar signs).Rather than spending time reinventing the wheel, I’ll borrow code from the other file, so I can move on to solving the next problem. There are countless occasions where I’m working on a client’s app and have a need for a similar process that I’ve already done for someone else. If you want to re-use that code in another file and you copy and paste your script, things will break if the other file doesn’t have a table and field with the same name.Īt LuminFire, we try to build as much of our code as we can in a modular fashion. But the other advantage is much more profound: scripts that use custom dialogs just became modular! While it may not seem like a big deal to add a field to support your script, that means that your script has a dependency. The first advantage that comes to mind is that we no longer need to clutter up our database schema with global fields dedicated to the purpose of user input in scripts. Why you should start using this feature now… Here is what the dialog looks like now, with a pre-populated variable: Just like a field as input, if the variable already exists in the script with a value, that value will be present in the field when presented to the user. We can still choose a field if we want, but we now have the option to specify a Variable. This is what we see now when we check the box to show an input field or click on one of the Specify buttons: But now in FileMaker 17, we can specify a variable instead. But what if what we are asking doesn’t belong in a field? Or if the script needs to do some validating or processing before we allow the data in our field? The standard work-around has been to use a global field to capture the user input as a temporary holding place. This is helpful when the field in question isn’t visible or editable on the current layout, or the script workflow takes the user out of the normal data entry layout. Sometimes that is convenient – we can ask a question and have the user enter data directly into a field via the custom dialog. Up until now, we had to have a field to collect that data. It presents up to 3 fields for the user to enter data. The Input Fields pane lets us ask the user for input beyond just a button click. There is one more area of options that we didn’t get to yet. Here is a basic example of script branching, based on the user button selection: OK, then what has changed? This may be different in different countries or localizations. Note that in the options dialog, they are listed in order top to bottom, with button #1 labeled “Default Button” and the custom dialog displays the button in order from right to left, per standard user interface design patterns. We test using the function Get ( LastMessageChoice ) to detect if the user clicked button 1, 2, or 3. This is what that dialog would look like to the user: Here is the main tab of the Show Custom Dialog options window: Think of it as the FileMaker version of Choose Your Own Adventure! We can specify up to 3 buttons, and take different actions based on those choices. To review, the Show Custom Dialog script step allows a script to show information to a user in a dialog box, and ask for input from the user to implement script branching. Hooray! The Show Custom Dialog script step It’s an enhancement to the Show Custom Dialog script step: we can now specify a variable to use for user input fields. It may seem like a minor change, but it will have a huge impact on how we code things in FileMaker, moving forward. This feature is one that I would call a “sleeper” feature. Be sure to check out the other posts and keep an eye on our blog page for the latest news. FileMaker 17 was released this week, and LuminFire has a series of blog posts highlighting our favorite features.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |