1answers

Criteria Validation

We have a need for a user to click on a checkbox for purpose of deeming something Complete. It is an important decision in our solution because once deemed Complete it will set up other options we need to do. We want to be sure this is the correct decision. I would like know about any methods of making an important decisions trigger have to be released with a safety. I was imagining a Script that displays a message that kind of gives a checklist or some things to consider before deeming something Complete. I guess a Script could take a user to a layout and give them just that. a checklist that once all criteria is met (checked) it could continue the Script and allow for the Complete choice to be chosen and If not, it will not allow it. I was thinking there may be other ways so I am inquiring.

Chris Johnston

Answers

To restate what you're trying to accomplish, you want to ensure that certain conditions are met before marking a record "complete".

In the world of databases, these are referred to as criteria validation and record status.

In code speak:

IF Status = Complete THEN SetField (TBL::Flag_Complete ; 1 )

So, what you are really after is a good way to validate that your specified criteria are met. Right?

There are numerous ways to accomplish this.

You could create a field TBL::Flag_Complete and allow users to click a checkbox that sets the value to 1. But that approach doesn't lend itself to recording when that field was set nor by whom. And, how many different fields would you need to create - one for each task that needs to be done? That could get exhausting!

I prefer to use related records to create task checklists. This approach makes adding additional tasks as well as systematically tracking who marked them done and when straightforward.

Most importantly, this approach makes determining a record's status easy as you can simply count the number of completed tasks as compared to the total number of tasks.

Here's a simple calculation that I wrote to determine a record's status based upon the number of completed tasks.

Grasp Learning Charting Example Chart Setup Window - Grasp Learning

It also opens up a lot of interesting UI design opportunities, e.g. graphically displaying the completion percentage of the record.

Here's the simple solution that I came up with:

Grasp Learning Charting Example Chart Setup Window - Grasp Learning

This example file features a simple task list accompanied by a graph. The checkbox calls a simple script which records who clicked the checkbox and when. The "Next Script" button cannot be run until the record's status is "Complete".

The chart uses a really simple calculation that counts the total number of tasks and the number of completed tasks.

Grasp Learning Charting Example Chart Setup Window - Grasp Learning

In order to accomplish the particular behavior of the pie chart, I set the data source to Current Record (delimited data).

Grasp Learning Charting Example Chart Setup Window - Grasp Learning

Once all of the tasks are completed, the record status changes to complete and the "Next Script" can be run.

Grasp Learning Charting Example Chart Setup Window - Grasp Learning

Download the example file here:

FileMaker Record Status Example.fmp12

Kevin Kurpe

Back to questions