Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7639 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Date Finds are a little odd. When you type into a Date field, you are entering text, which FileMaker will evaluate for correctness before allowing you to continue. This is true in Find mode also.

When you do it manually FileMaker is more forgiving. But Set Field [] is not forgiving. It has to be something FM will consider a date, without coercion.

Any criteria that is not really a date has to entered as if you were entering it manually. Steps that do that are Insert Text and Insert Calculated Result. Whatever criteria you put in the step should be considered text. (More on this for ranges, etc., but that's not what you asked.)

In this case the simplest is:

Insert Text [ Date field, "=" ]

Omit Record

(Just type the =, FM adds the quotes.)

The limitation of both these steps is that the date field has to be on the current layout. It does not, however, have to be enterable. You can hide it by making it 1 pixel tall and wide, non-enterable, text size 1, no lines or fill, not in the Tab Order.

Posted

Fenton's suggestions are all accurate. Date and time fields contain data unlike other fields and need to be treated carefully. Set Field will not work with these fields. Especially important is to have the date field on the current layout at the moment the script needs it. Making a tiny invisible date field is one technique, another is to place in the script before the enter find function a Go To Layout function and take us to a layout with the date field while the find is running. Afterward, if necessary, you can use another Go To Layout to take us back to where we need to be.

Also, if you are scripting a find in this way (as opposed to memorizing the find in the script), then make sure that both the Enter Find Mode and Perform Find functions have the "Restore" option clicked off, or you will get strange results.

Steve Brown

This topic is 7639 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.