Jump to content
Server Maintenance This Week. ×

A very simple question... for some


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

Recommended Posts

  • Newbies

Hi I am just learning filemaker pro ver 5. I am tyring to create a button that performs the following task

1.enter find mode

2.auto enter some text into a specified field

3 perform the search

I have been playing around with the scriptmaker, I can do 1 and select the field but cant enter the text. I have been playing wiht the "insert Text option" but I cant get it to work.

Help!

Link to comment
Share on other sites

>>>PerformFind[Restore, No dialog]. This will perform the last find >>>you did.

Which "last find" will the script perform? The last find performed before the script was last altered? The last find before the script is called up?

I had to create a series of scripts, each finding records belonging to 1 of 6 different categories. Before I created each one I manually performed the find and told the script to "restore without dialogue" that request. Then I "replaced" the find request when the final dialogue box asked if I wanted to keep or replace.

Was I correct in "restoring"? Was I correct in "replacing"?

Link to comment
Share on other sites

You want the "Modify Last Find" script step to recall the last find performed. Note that if there is no last find it'll break, so you need to trap for it:

Set Error capture [on]

Modify Last Find

If [ Status(CurrentError) <> 0 ]

Enter Find Mode []

End If

Link to comment
Share on other sites

Sounds right to me. The last find performed means just that, regardless of whether it was done by a script or manually. Opening a script, closing the script, and selecting "replace" will capture the last find for a Perform Find(restore) script step. Remember that only one find definition can be saved per script, even if you have multiple find statements.

As a matter of programming technique, I never use Perform Find (restore). It is not self documenting. The only way to determine the find being performed is to 1) perform it and do a refind on an "All Field" layout or 2) print the script. I exclusively use:

Enter Find Mode ()

Set Field (field1, value)

Set Field (field2, value)

.

.

.

Perform Find ()

or some variation. Use Set Field, where possible as it doesn't require the field be visible on the current layout. The "Insert Text" script step fails when the field inserted to isn't on the current layout.

-bd

Link to comment
Share on other sites

This topic is 8211 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.