Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Find using input fields in Custom Dialog?

Featured Replies

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

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

  • Author

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

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

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

Have you checked that the Global and the field on which you are finding are the same type?

  • Author

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

Could you post a screenshot of your script?

  • Author

Ender,

Forgive my ignorance, but how do I get the screen shot in the post? Attach the .pdf? (I'll try that first).

Thanks,

EB

Picture2.pdf

  • Author

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

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.

  • Author

-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

Are you sure that you have made this a global field? It sounds like a normal field.

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.

  • Author

Thanks so much to all of you. Ralph, I'm embarrassed blush.gif to say you were right.

EB

  • 2 weeks later...

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.

Hmm. I thought we resolved that about 15 days ago. wink.gif

Thanx people. I used the lesson here. Thought I should acknowledge.

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/....

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.