Show Custom Dialog

Displays a custom message dialog box, with custom text and labels.

See also

Options

General options

Input Field options

Compatibility

Product Supported
FileMaker Pro Yes
FileMaker Go Yes
FileMaker WebDirect Yes
FileMaker Server No
FileMaker Cloud No
FileMaker Data API No
Custom Web Publishing No

Originated in version

Description

The "Show Custom Dialog" Options dialog box allows you to set the dialog box title, message text, and buttons, and specify up to three fields or variables to use for input or display. The script pauses as long as the custom dialog box stays on the screen. Fields used for input can be of type text, number, date, time, timestamp, or container. Variables used for input store values as text. Your custom dialog box can also have up to three buttons, with custom button titles.

Use the Get(LastMessageChoice) function to determine which button the user presses.

Notes

Example 1

Performs a find. If no records were found, displays a custom dialog box.

Perform Find [Restore]
If [Get (FoundCount) = 0]
Show Custom Dialog ["No records were found."]
End If

Example 2

Creates a new record, prompts the user to enter information, then goes to the Customer Details layout. The first button is Cancel so that users don't inadvertently create a record by pressing Return or Enter in the custom dialog box.

Freeze Window
New Record/Request
Show Custom Dialog ["New Customer"; "Enter information into the fields below:"; Customers::Company; Customers::Name; Customers::City]
If [Get ( LastMessageChoice ) = 1]
Delete Record/Request [With dialog: Off]
Else
Go to Layout ["Customer Details"]
End If

Example 3

Enters Find mode, prompts the user for find criteria, and performs the find. If the find returns no records, asks if the user wants to find again, and either performs the script again or halts all scripts.

Script: Find

Enter Find Mode [Pause: Off]
Show Custom Dialog ["Find customers by ID, name, or city."; Customers::ID; Customers::Name; Customers::City]
If [Get ( LastMessageChoice ) = 1]
Perform Find [ ]
If [Get ( FoundCount ) = 0]
Show Custom Dialog ["No records were found. Find again?"]
If [Get ( LastMessageChoice ) = 1]
#Calls this script as a sub-script
Perform Script [Specified: From list ; "Find" ; Parameter: ]
Else
Show All Records
#Halts all scripts and sub-scripts
Halt Script
End If
End If
Else If [Get ( LastMessageChoice ) = 2]
Enter Browse Mode [Pause: Off]
End If

Related topics

Was this topic helpful? Send feedback.