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

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

Recommended Posts

Posted

Hello,

I've searched this forum, but couldn't find an answer. Forgive me if it's redundant.

Is it possible to use the Input Fields in the Custom Dialog for a find? I've tried using globals as the input fields and then a Set Field in the script, but I'm not getting anywhere.

Has anyone successfully done this & willing to share the correct way to make it work?

Thanks very much.

Elizabeth

Posted

Hi, Elizabeth. Are you in Browse mode when the custom dialog is called? That may be an issue. If you're in Find mode, you will not be able to enter text into the global. Do the Custom Dialog first, then enter Find mode and do the Set Field step.

HTH

Jerry

Posted

Hi Jerry,

Yes, I'm in Browse mode. Briefly, the script goes like this:

Enter Browse Mode

Clear the Globals

Show the Custom Message (which gets the user input into the globals)

Enter Find Mode

Set Fields....

Perform Find

The Set Field step is not working. I'm getting the "No valid criteria" message.

I'm sure I'm missing something.

Thanks again for any guidance.

Elizabeth

Posted

Hi, the exact same script works for me in FM6, and my machine with FM7 on it is currently on strike, so i can't help you there. One last thing i can think of to check... on Enter Find Mode and Perform Find, have you unchecked "Restore Find Requests?"

Also, i notice you have typed in "Set Fields." If that's not a typo, try taking out all Set Field steps other than the one you need to see if those might be causing unexpected problems.

J

Posted

Make sure the custom dialog has the OK button set to button 1 -- values do not get updated unless button 1 is clicked.

Posted

Thanks, Vaughan and Paul.

The custom dialog does have the OK button set to button 1. Both the global and field on which I'm trying to find are text fields. The field doesn't seem to be set until I cancel the find. My understanding from the custom dialog set up is that the "data entered by the user will be stored in that input field." I even tried using Set Field after the custom dialog (hence after user input) to no avail. I don't know what I'm doing wrong!

So I've got a global text field - gProgramName, and a text field ProgramName. I ask the user for input in the custom dialog into the gProgramName field. The user clicks OK, then I enter Find Mode, then I use Set Field to get the value of gProgramName into ProgramName. Then it should perform the find. It doesn't happen. I get the "no valid criteria" error. I put the global on the layout to see what's going on, and after I cancel (or continue) the find, the global is then set.

I hope that I'm making sense as far as my steps. I'm new to FMP 7 and confused!

Thanks so much.

Elizabeth

confused.gif

Posted

Well, that obviously didn't work, and I can't figure out how to get the screenshot in the post, so I'll type the script.

Enter Browse Mode []

Clear [select; Providers::gProgramName]

Show Custom Dialog ["Find Provider"; "Enter your find criteria and click "OK"; Providers::gProgramName]

Enter Find Mode []

Set Field [Providers::programname; Providers::gProgramName]

Perform Find/Replace []

It seems so simple. I know I'll feel like a fool when I discover my mistake. Thanks for everyone's help so far.

Elizabeth

Posted

Perform Find/Replace is not the step you want. You want the Perform Find step under the Found Sets layout. Also, Set Field [Providers::gProgramName; ""] is preferable to the Clear step.

Posted

-Queue-

Thanks. I made the changes you suggested, however, when my script enters find mode, the value in the global still goes away (?) and so doesn't get passed when Set Field is called. I then get the "no valid criteria in this request" error. When I cancel, the value of the global "appears", which means it's *there* but not in find mode. Does that make any sense?

I'm puzzled! Any other thoughts?

Elizabeth

Posted

Make sure the Enter Find Mode and Perform Find script steps both have the option to restore find requests TURNED OFF.

THe other problem might be that you are trying to Set non-valid data into the field. This happens if you try to serach for ">1/1/2004" in a date field, because the ">" symbol makes the date invalid.

Try using Insert Calculated Result step instead, but if you do be aware that this script step is layout dependent: make sure the current layout has the appropriate field on it.

  • 2 weeks later...
Posted

I can see the problem. Promise you won't commit suicide, beat yourself up, use bad language? (I know how you feel.)

That last step should be -

Perform Find []

Find/Replace is the editing command for fnding and replacing text or whatever.

Posted

You're dead right! Don't know what happened. Actually I do know but I'm not going to admit it. It wasn't me. It was someone else. It was a virus/hacker/power failure/....

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