Jump to content

Find record


Tmonk

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

Recommended Posts

Ok. Please note I am very new to FM with little experience. I have created several files where the relationships work fine. smile.gif Now, I'm trying to create a layout that will give someone the ability to find a record by either Last name, Id number, or phone number.(I have defined all these fields) I want to give them the choice on which search would work best. Once a record is found, or group of records, I would like the layout to switch to the "PlayerInfo" layout to either view the record(s) or be able to edit.Can anyone lead me down the path of knowledge, or at least to the front door?

Link to comment
Share on other sites

Tmonk ...

Question:

What do you mean by: "I want to give them the choice on which search would work best."? Wouldn't they be doing this by entering their search criteria into the most relevant field in Find Mode?

Assuming the records are in the same file from which the search is being performed:

Go To Layout [the layout containing the fields you want to allow users to search on]

Enter Find Mode [Pause] (--be sure to deselect the "Restore Find Requests" checkbox)

# user enters their find criteria. When finished entering their find criteria the user presses the "Enter" key, which continues with the rest of the script

Perform Find (--be sure to deselect the "Restore Find Requests" checkbox)

If [status(CurrentFoundCount) > 0

# The sort step is optional. The sort order in place when the script is created is the one used in the "Restore" option You can change this by performing the sort you want repeated in the script, then opening the script and closing it, selecting "Replace" next to the "Sort Order" option.

Sort [Restore]

Go To Layout ["PlayerInfo"]

Exit Script

Else

Show Message ["No records matching your criteria were found"]

Go To Layout [Original Layout] (or whatever layout you want the user taken to)

End If

I may be missing something in your question, but this is all pretty straightforward. If I'm mistaken about what you're trying to do, can you clarify a bit more?

Link to comment
Share on other sites

I've set up several universal finds. What I do is create a global field that is visible on the user layout. This is where they enter their find criteria. Note they they can enter *anything* in the global, whether it be name, phone number or ID number (no need to decide what criteria they will be searching for & choose from several find options). They click a "go" button that activates a script. This script will:

Enter Find Mode (Restore UNchecked)

Set Field (Name, g_Search)

New Find Request

Set Field (Phone, g_Search)

New Find Request

Set Field (ID, g_Search)

Perform Find (Restore UNchecked)

Go to Layout (PlayerInfo)

Set Field (g_Search, "")

This will search all three fields for anything entered, take the user to the correct layout, and clear the global field for the next user.

This is a basic, simplified version of the concept. In my work, using a similar search can bring up several possible results. I have a test in the script to see if the found set is one or more than one. If one, it goes to display layout. If more than one, it goes to a list layout that has needed info in each line. There's a button on each line that directs to display layout. The user scans the list & clicks the button next to the correct item to view display.

Steve Brown

Link to comment
Share on other sites

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