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

multiple fields required for search

Featured Replies

  • Newbies

How do I require that 2 or more fields be filled in a search request. I am trying to secure customer records by requiring either invoice # and zip code or last name and zip code. I can not seem to find documentation of this kind of setting. Help? cool.gif

Script the Find process. It'll look something like this...

code:


Enter Find Mode [pause]

Perform Find []

In between these two steps you can perform checks to ensure that the find request has an entry...

code:


Enter Find Mode [pause]

If [isEmpty(Invoice Number) or IsEmpty(Zip)]

Beep

Show Message ["Enter an Invoice # or Zip code.", OK]

Enter Browse Mode []

Exit Script

End If

Perform Find []

...if the Invoice Number or Zip fields have no search criteria entered the script beeps, shows the message then exits the find process.

You could make it a bit nicer (and significantly more complicated) by making the script loop until a zip or invoice number is enetered into the find request. It'd look like this...

code:


Enter Find Mode [pause]

Loop

If [isEmpty(Invoice Number) or IsEmpty(Zip)]

Beep

Show Message ["Enter an Invoice # or Zip code.", OK]

Else

End Loop If [1]

End If

End Loop

Perform Find []

Of course, it'd be a good idea to give people a way to cancel out of the loop...

code:


Enter Find Mode [pause]

Loop

If [isEmpty(Invoice Number) or IsEmpty(Zip)]

Beep

Show Message ["Enter an Invoice # or Zip code.", OK, Cancel]

If [status(CurrentMessageChoice) = 2

Enter Browse Mode []

Exit Script

End If

Else

End Loop If [1]

End If

End Loop

Perform Find []

  • Author
  • Newbies

Thanks Vaughan for your help!

In scripting this I find that I am not able to find End Loop If [ ] in my script options. I am on filemaker 5.0. Also I am getting automatic " " around any entry into the if and show message steps. Am I dim or what?

Thanks crazy.gif

Another approach is to have a 2nd layout ("search") from which to perform the find and which displays just the fields you want included. Write a script which is activated from a button.

Go to Layout ["search"]

Enter Find Mode [Pause]

If [isEmpty(Invoice Number) or IsEmpty(Zip)]

Beep

Show Message ["Enter an Invoice # or Zip code.", OK, Cancel]

Go To Layout ["search"]

Enter Find Mode [pause]

End If

<comment, format a button on the "search" layout to "resume script">

Perform Find []

If ["Status(CurrentError) = 401"]

Go to Layout []

<comment, you make a navigation choice if no records are found>

Else

If["Status(CurrentFoundCount) = 1"]

Go to Layout []

<comment, you make a navigation choice if only one record is found>

Else

If["Status(CurrentFoundCount) > 1"]

Go to Layout []

<comment, you make a navigation choice if more than one one record is found>

End If

End If

End If

[ March 20, 2002, 03:48 PM: Message edited by: Keith M. Davie ]

quote:

Originally posted by mark:

Thanks Vaughan for your help!

In scripting this I find that I am not able to find End Loop If [ ] in my script options. I am on filemaker 5.0. Also I am getting automatic " " around any entry into the if and show message steps. Am I dim or what?

Thanks
crazy.gif

"Exit Loop If" is the script step that gets you out of a loop.

Regarding the quotation marks, don't worry about them; they show up in the script step to show you what the "If" statement or "Show Message" is.

  • Author
  • Newbies

Keith,

Thanks so much it worked. I am going to try to add the last name field as an alternate to the invoice # is the customer does not have their receipt.

Thanks again! smile.gif

Create an account or sign in to comment

Important Information

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

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.