filesoft.Discuss a project

02 / FIND OPEN WORK WITH ONE CLICK

Show the work
that still needs you.

Add Open tasks and All tasks buttons to your overview. Search reliably, sort by due date and explain an empty result.

45–60 minutesFileMaker Pro 26 · macOSPractice + six-question quiz

Keep your navigation and records.

Save and close your Lesson 1 working file. Back it up and continue in a copy. Keep the left-anchored navigation buttons and the report’s Back to Tasks button.

The starting download is the saved Lesson 1 Example 0.1.1. The completed example adds four scripts in two folders and two buttons in the overview Header. It preserves the tables, relationships, validation, existing scripts, report and record data. Your own task counts may differ from the examples below.

Your outcome

Open tasks selects exact Open status and orders the result by due date. All tasks restores the complete task list. Neither search changes a task’s status or deletes a record.

1. Separate finding from sorting.

Work on Follow-up Overview, based on FollowUps, in Browse mode and List View. A find selects which task records belong in the found set. A sort orders those records. The toolbar and sTaskCount summary both describe the task found set.

The criterion ==Open matches the entire Status field. It is entered into a Find request, not into an ordinary record. Do not run Set Field with that criterion while browsing a task.

This is a search you run on demand. It is not a live filter. If you change a status afterward, click Open tasks again to rebuild the result. All tasks includes both Open and Done tasks.

2. Understand the four search steps.

Start by reading the successful path. These four steps explain what the search does; the complete button script adds the safeguards explained next.

FileMaker script

Enter Find Mode [ Pause: Off ]
Set Field [ FollowUps::Status ; "==Open" ]
Perform Find
Sort Records [ Restore ; With dialog: Off ]
  1. Enter Find Mode: turn Pause off and leave specified find requests empty.
  2. Set Field: select FollowUps::Status directly and enter "==Open" as the calculated result, including the quotes. This fills a search request.
  3. Perform Find: leave specified find requests empty so it uses the request just created.
  4. Sort Records: specify FollowUps::DueDate ascending, then FollowUps::Task ascending. Keep records in sorted order, leave blank values last off, and turn With dialog off. Restore means the sort order is stored in this step.

This is a reading excerpt, not the complete script to attach to a button. Build the complete version below before running it.

Add the essential safeguards.

Think of error handling at three points in that flow:

  • Before searching: confirm Browse mode on Follow-up Overview, then commit with validation. If saving fails, stop so the learner can correct the entry.
  • Immediately after Perform Find: capture Get ( LastError ) in $findError. Later steps can replace the error value.
  • Before sorting: handle 401 with “No Open tasks found” and stop. Handle any other nonzero find error with a failure message. Only sort a successful result.

The controller returns a message to its UI script, which displays it. An empty string means success. The initial commit can save valid pending edits; the search itself does not change task values.

Full script with safeguards: Open tasks

In Script Workspace, create Search UI and Search Controller folders. Create Search | Find Open Tasks in Search Controller and keep it hidden from the Scripts menu. Add the steps below, using the four step settings above. Keep Skip data entry validation off in Commit Records/Requests.

The complete example also checks whether Find mode opened, the criterion was set and sorting succeeded. If setting the criterion fails, it returns to all records and explicitly reports that fallback. You can follow these extra checks after you understand the main search.

FileMaker script

# PURPOSE: Find exact Open status without editing tasks; sort the result by DueDate and Task.
# HISTORY: 2026-OCT-08    Plato    Create Course 3 Lesson 2 search.
If [ Get ( WindowMode ) ≠ 0 or Get ( LayoutName ) ≠ "Follow-up Overview" ]
    Exit Script [ "Use these search buttons on Follow-up Overview in Browse mode." ]
End If
Commit Records/Requests [ With dialog: Off ; Skip data entry validation: Off ]
If [ Get ( LastError ) ≠ 0 ]
    Exit Script [ "Finish or correct the current entry before searching." ]
End If
Enter Find Mode [ Pause: Off ]
If [ Get ( LastError ) ≠ 0 ]
    Exit Script [ "Find mode could not be opened." ]
End If
Set Field [ FollowUps::Status ; "==Open" ]
If [ Get ( LastError ) ≠ 0 ]
    Show All Records
    Exit Script [ "The search criterion could not be set. All tasks are shown; please try again." ]
End If
Perform Find
Set Variable [ $findError ; Value: Get ( LastError ) ]
If [ $findError = 401 ]
    Exit Script [ "No Open tasks found. Use All tasks to see the complete list." ]
End If
If [ $findError ≠ 0 ]
    Exit Script [ "The search could not be completed. Use All tasks, then try again." ]
End If
Sort Records [ Restore ; With dialog: Off ]
If [ Get ( LastError ) ≠ 0 ]
    Exit Script [ "The found set is available, but it could not be sorted by due date." ]
End If
Exit Script [ "" ]

3. Provide a way back to every task.

The successful path for All tasks is shorter: show every record, then use the same sort order.

FileMaker script

Show All Records
Sort Records [ Restore ; With dialog: Off ]

Use the same mode/layout guard and validated commit before this excerpt. If the table has no tasks at all, explain how to add one through Contact Actions. An empty table is different from a search that found no matches.

Full script with safeguards: All tasks

Create Search | Show All Tasks in Search Controller, hidden from the Scripts menu. Copy the configured DueDate/Task sort from the Open controller.

FileMaker script

# PURPOSE: Show every task and sort by DueDate and Task without changing record data.
# HISTORY: 2026-OCT-08    Plato    Create Course 3 Lesson 2 search.
If [ Get ( WindowMode ) ≠ 0 or Get ( LayoutName ) ≠ "Follow-up Overview" ]
    Exit Script [ "Use these search buttons on Follow-up Overview in Browse mode." ]
End If
Commit Records/Requests [ With dialog: Off ; Skip data entry validation: Off ]
If [ Get ( LastError ) ≠ 0 ]
    Exit Script [ "Finish or correct the current entry before searching." ]
End If
Show All Records
If [ Get ( LastError ) ≠ 0 ]
    Exit Script [ "All tasks could not be shown." ]
End If
If [ Get ( FoundCount ) = 0 ]
    Exit Script [ "There are no tasks yet. Add one through Contact Actions." ]
End If
Sort Records [ Restore ; With dialog: Off ]
If [ Get ( LastError ) ≠ 0 ]
    Exit Script [ "The found set is available, but it could not be sorted by due date." ]
End If
Exit Script [ "" ]

4. Connect two clear actions.

Create Search | Open Tasks Button Pressed and Search | All Tasks Button Pressed in Search UI. Choose the matching controller directly in Perform Script. Set Error Capture on and Allow User Abort off. Show Custom Dialog needs one OK button, no input fields and commit data off.

The UI follows the same pattern as Lesson 1: capture errors, call the controller and display any returned message. Expand the listings when you are ready to configure the buttons.

Open tasks: complete UI listing

FileMaker script

# PURPOSE: Run the task search and display its returned message.
# HISTORY: 2026-OCT-08    Plato    Create Course 3 Lesson 2 search.
Set Error Capture [ On ]
Allow User Abort [ Off ]
Perform Script [ "Search | Find Open Tasks" ]
If [ Get ( ScriptResult ) ≠ "" ]
    Show Custom Dialog [ "Task search" ; Get ( ScriptResult ) ]
End If
All tasks: complete UI listing

FileMaker script

# PURPOSE: Run the task search and display its returned message.
# HISTORY: 2026-OCT-08    Plato    Create Course 3 Lesson 2 search.
Set Error Capture [ On ]
Allow User Abort [ Off ]
Perform Script [ "Search | Show All Tasks" ]
If [ Get ( ScriptResult ) ≠ "" ]
    Show Custom Dialog [ "Task search" ; Get ( ScriptResult ) ]
End If

These formatted listings are reading guides: add and configure native script steps in Script Workspace rather than pasting the listing as plain text.

  1. In Layout mode on Follow-up Overview, duplicate the Tasks navigation button twice into the Header. Keep Contacts, Tasks and Report in place.
  2. Label the copies Open tasks and All tasks. The example uses 132 × 30-point buttons at horizontal positions 428 and 572, with the same top position as navigation. Keep left and top anchors; turn off the right anchor.
  3. Set each button to Perform Script using its matching Search | … Button Pressed UI script. Keep parameters empty. Do not bind it to a controller directly.
  4. Save the layout and return to Browse mode, List View. Keeping the controls in the Header makes them available when a find has no matching task rows.

Try both results—and no result.

Open tasks: one matching task out of four. Alex Morgan’s “Send project outline” has Status Open, and the summary shows 1.
Course 3 Lesson 2 Example 0.1.0 · Open tasks: one matching task out of four. Alex Morgan’s “Send project outline” has Status Open, and the summary shows 1. Dates use month/day/year. Select the image for full size.
All tasks: all four tasks are visible again, sorted by due date. The summary shows 4, including one Open task and three Done tasks.
Course 3 Lesson 2 Example 0.1.0 · All tasks: all four tasks are visible again, sorted by due date. The summary shows 4, including one Open task and three Done tasks. Dates use month/day/year. Select the image for full size.
  1. On Follow-up Overview in List View, click All tasks. Compare the toolbar and summary counts with your actual tasks. Check ascending DueDate order, then Task order for equal dates.
  2. Click Open tasks. Every displayed task should have Status Open; Done tasks disappear from this found set. In the supplied four-task data, the expected result is Alex Morgan’s “Send project outline,” unless you have changed those records.
  3. Click All tasks again. Confirm the Done tasks return with their original statuses. Repeat both actions; no new records should appear.
  4. In a disposable practice copy, set every task to Done and commit. Click Open tasks. Expect the no-matches message and an empty found set. Dismiss it and click All tasks; every task must return. Discard this practice copy afterward.
  5. In a practice copy, clear an existing task’s required Task text, then click Open tasks. Expect a save/validation message before Find mode. Restore its description and commit. Try the search again.
  6. Find Open tasks, click Report and check that the report contains that found set. Exit Preview if needed, then Back to Tasks. Click All tasks before making a report of everything.
  7. Resize the window and check that all five Header buttons remain readable and anchored left. Save, close and reopen; confirm the controls and original records remain. Rerun each search after opening.
Compare your result

Open tasks shows only Open records in due-date order. All tasks restores the full list, including Done records. A zero-match find explains what happened; the next All tasks click recovers the full list. Invalid entry stops the search. Report uses the selected task found set.

Check your understanding.

Choose one answer for every question. Answers and scores stay in this page.

01 Why enter Find mode before Set Field?
02 What does error 401 mean after Perform Find?
03 Why capture Get ( LastError ) immediately?
04 What does All tasks do?
05 Does sorting by DueDate hide Done tasks?
06 After changing a task from Open to Done, what refreshes the Open result?

Next: recognize overdue work.

Continue to Lesson 3 to add an overdue indicator that distinguishes Open tasks due before today from Done and future work. Keep your completed working file.

Return to the course outline ↗

Further reading