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

Combine search fields and results portal on same layout?

Featured Replies

I have seen a db solution built in .Net that has a layout with search fields at the top and a portal of results at the bottom. Once a user enters search terms or selects from valid values, there is a "Get Records" button that perfoms a search and returns the results in a portal on the same screen.

Is this possible in FM8?

I have already created a screen that has the portal using a self-join and can be filtered with the value list fields, but is it possible to enter a search field where the user can enter a text string and have the results appear in the portal?

Take a look at the following:

http://www.filemakerpros.com/TYPEAHEAD.zip

You can use a multi-line key to get what you want.

Set up your portal to display records from a relationship between a global (G_multi) and the record ID

From your layout perform the find using a button with a script along the following lines attached to it.

Perform find

Set field G_multi;""

Go to record first

Set field G_multi;RecordID

Loop

Go to record next(exit after last)

Set field G_multi;G_multi & ":paragraph:" & RecordID

Endloop

This makes the the field G_Multi a key that contains all the id's of the found set.

Your portal will (should) therefore display the found set

HTH

Phil

Edited by Guest

  • Author

thanks inky. so how would the script know what field to do the find on? i created the script that you mentioned and it does combine all the keys. now how do i filter based on my keywords entered?

sorry i am naive to this!

In it's simplest form just create a layout that has

1/ The fields on it that you wish to search by.

2/ A portal that uses your relationship (as previous)

3/ A 'find' button

Go to this layout and enter find mode (either manually or by script)

The user can then enter the data that they wish to find on. Then press the 'find' button which should perform the script as previous but with the addition of an 'enter browse mode' step after the 'perform find' step.

This should leave them back in browse mode looking at the found set in the portal.

I stress that this is a very simple approach which does not follow any form of 'best practice' method nor does it make provision for any error trapping (if there are no found records eg) but since you seem to be finding your way it might not be a bad starting point

HTH

Phil

  • Author

thanks Phil. i think that this may be the best solution. this is close to what i was looking for.

so if a user presses the built in "Find" button that FM displays would this still work?

thanks again!

Well.....It would but they would have to do all the other steps themselves (enter find mode,enter browse mode,run a script to set the multi key up).

You might as well do it all through scripts

Phil

  • Author

yes, i was trying to prevent them from using the built-in find button so that i can script it. i assume i would have to hide the status area for this layout?

also, how would i add another button to show all the records in the portal? i tried a "show all records" but that didnt seem to work.

thanks again Phil!

  • 4 weeks later...
  • Author

thanks again for this script. it works great in getting the search results to display in the portal. BUT i cannot figure out how to add a button script that will SHOW ALL RECORDS in the portal.

Can anyone help? Thanks!

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.