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

Combine search fields and results portal on same layout?


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

Recommended Posts

Posted

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?

Posted (edited)

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
Posted

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!

Posted

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

Posted

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!

Posted

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

Posted

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

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!

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