Jump to content

Always have Layout in "Find" Mode


gata

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

Recommended Posts

Hello,

I am working on a kiosk solution for a bookstore. I want the entry page of the kiosk to be a search page. I need to make this as simple as possible for the general public to browse a database of books. On the entry page, I would like to place fields for "author", "title" etc.

How can I set this page so that it is always in "find" mode? I would like to put a button on each record page to go back to the "entry" page, and each time it does this, I need the search fields to be empty. Any ideas of how to write a script to make the entry/search page always in find mode?

Any help appreciated,

Catherine

Link to comment
Share on other sites

In a kiosk solution you totally control the navigation, so when the user clicks the "entry" button, run your "Find" script. This script should Allow user abort (OFF), enter Find mode and then Pause. Find mode always clears the fields. Continue the script by pressing Enter or clicking a button (which does nothing, it's just set to Resume script). The rest of the script traps for errors, goes to list or data screen etc.

Alternatively, you could create global fields for the search screen, and you script would clear them out when you return to the screen. This would be a little more work and I don't think will add much value to the basic method outlined above.

Link to comment
Share on other sites

Thanks for the reply!

I tried this out:

Layout#1 consists of a "welcome to the books database" page, with a "search" button at the bottom. There is a script attached to the "search button" which goes as follows:

Allow User Abort [Off]

Go to Layout ["Search"]

Enter Find Mode ["Pause"]

When the user presses the button, they go to the "Search" page, with the Author/Title Fields blank-in Search mode...so that works.

When they fill in the Author field (ex. Hemingway), and hit "enter" nothing happens. I added a button that will take them to the next layout, which will contain the found records, but I am stuck because

"Find" mode will not complete until I hit "find" in the side menu. Then I am stuck with a found set, but not on the correct layout.

Related to this is: if I implement this in Kiosk mode, how does the user know how to navigate the records, (ie. the found set) without using the little side navigation controls- the scroll bar or "book"?

Thanks for any assistance,

Catherine

Link to comment
Share on other sites

just add the following steps to your script

Find

Go to Layout "Found Set"

You should trap the "No records found" situation, though...

Navigation:

you have to recreate the "book" by including your own back & forth buttons (go to next/previous record).

Link to comment
Share on other sites

Like I (and cj) said, the REST of the script (i.e. after the Pause) traps for errors, etc. This is all one script:

Set Error Capture [ On ]

Allow User Abort [ Off ]

Go to Layout [ Search ]

Go to Field [ Author ]

#

Enter Find Mode

Pause/Resume Script [ ]

#

Perform Find [ Replace Found Set ]

#

If [ Status(CurrentFoundCount) = 1 ]

. Go to Layout [ Detail ]

. Exit Script

End If

#

Go to Layout [ List ]

#

If [ Status(CurrentFoundCount) = 0 ]

. Show Message [ Buttons:

Link to comment
Share on other sites

This is really helpful- Thank you for the assistance.

I have a question- probably ridiculous, but I can't figure it out-

I am writing the above script example in scriptmaker, and cannot put in any of the parameters. Believe me, I am new to this! I have only used simple script commands in FMPro in the past. I completely understand the code, and usually work in BBedit with any web coding that I do- I am just not used to the way Filemaker works.

When I choose from the set of commands, I am unable to modify them to match the code you have above. For instance, on an "If"statement, how do I insert the code to go in the brackets?

ie-- If [ Status(CurrentFoundCount) = 0 ]

I can't just type the "Status(CurrentFoundCount) = 0" part within the brackets, but I also can't insert throught the calculation dialog box

Deep apology for a dumb question- but I can't seem to use scriptmaker correctly!

Link to comment
Share on other sites

I did try that...by hitting Specify, you go to the calculation window. I am assuming that this is where you are to put in the parameters for the IF statement. However, I am not allowed to proceed by typing in the code shown below for instance:

If [ Status(CurrentFoundCount) = 0 ]

I just get error messagges and cannot proceed.

How do I modify this If statement so I can continue with next step- "Show Message"

arrgh! I feel kinda trapped cause I can't just type in the code! confused.gif

Link to comment
Share on other sites

The brackets are not part of the calculation. They delineate the beginning and ending of the parameters. Enter Get(FoundCount) = 0 or not Get(FoundCount) (they mean the same thing) into the calculation. When you click OK, you'll see

If [not Get(FoundCount)]

or

If [Get(FoundCount) = 0]

as the entire script step.

Note: Status functions don't exist in version 7. They are Get functions.

Link to comment
Share on other sites

Ah! So I am trying to write the example code from Fitch's very helpful post above, but it is not in the exact syntax...just a general set of directions which I need to modify into the correct FM scripting choices.

In other words, it is partially pseudocode to give the steps. Instead of typing Status(CurrentFoundCount) = 0, the right syntax is is Get(FoundCount) = 0, which works by the way.

Am I on the right track?

Link to comment
Share on other sites

Status functions were used in versions 6 and earlier. They have all been changed to Get functions in version 7. So, it's not pseudo-code; it's code for a different version. If you were using version 6, your script would look like his, when viewed as a whole in ScriptMaker, brackets and all.

Link to comment
Share on other sites

Sorry, I didn't notice your version when I posted that. My example is correct syntax for FileMaker 6 -- but Status() functions in FileMaker 6 have been replaced by Get() functions in FM7.

Let me know if you're not able to transmogrify the script and I'll repost it in FM7-speak.

Link to comment
Share on other sites

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