Let's assume that you have an email field on your Main Detail layout. How would the user send an email using this field? At present, it would be pretty time consuming: they would need to select and copy the contents of the field, open their email application, create a new email, and paste the address into the “To” box of the email. Happily, FileMaker Pro provides a way to automate this process.
Let’s add a functional button that makes use of this feature. You’ve already added a functional button to the right-hand side of the header, but sometimes it’s helpful to place functional buttons directly in the body of your layout instead.
Generally you do this for one of two reasons:
- You want the button to be part of a natural flow in the data entry process.
- The association of the button with a specific field or group of fields helps the user understand its purpose.
The example solution places email buttons (with an “envelope” icon) to the right of two different email addresses. Clicking on these buttons causes an email to be created, automating all the steps described above.
Note your button will need to call a script that doesn’t exist yet, so right now we’re just adding the button. After you create the appropriate script in Goal 5 ("Automate with scripts"), you’ll come back to this layout to associate the button with your new script.
Create a functional button for your email field and place it to the right of the field to communicate its purpose clearly.
- Reduce the width of your email field so that there’s space for a square button to its right.
- Create a button in the space you just made.
- In the Button Setup dialog, choose the second option (for icon only).
- Choose the "envelope" icon to represent an email.
- Use the slider to change the icon size to 18 pt.
You'll notice that the image is clipped. That's because the button object has padding applied to it. In a moment you'll change that using the Inspector.
Since the script doesn’t exist yet, you can’t specify it until you create it in Goal 5 -- so leave the Action as "Do Nothing".
- Click the OK button to dismiss the Button Setup dialog window.
- Using the Inspector > Appearance tab > Advanced Graphic area, change all four Padding options to 0.
- Using the Inspector > Appearance tab > Graphic area, change the Line option to "none".
- Using the Inspector > Position tab > Position area, change the Width and Height of the image to the same height as your field.
The example solution sets width and height of the button to .375 inches, which is what it uses for field heights.
- Using the Inspector > Position tab > Position area, enter the following text into the Tooltip box: Email [Main tablename]
The example solution uses “Email Contact”.
- Align the top edge of the button with the email field and the right edge of the button with the other fields in the group.
- Select your button and press Command-D (OS X) or Control-D (Windows) to duplicate it for any other email fields, then position the duplicate(s) appropriately.