Jump to content
Claris Platform 2023 Roadmap ×

User input for search

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

Recommended Posts

  • Newbies

Hello. I am quite new to FM and am trying to create a script that asks for user input and then performs a search based on that input. From my experimentation I found that the Custom Dialog writes the data to the field you specify, so I...

Created a field in my DB called var1, wrote the user input to that field and did a search for where the fields match - but no joy.

Any ideas? I seems like it should be simple (well it is in Access).



Link to comment
Share on other sites

Hi Michael, Welcome to the Forums ;)

It is easy once you've got a grasp of how things work -- the learning curve is MUCH quicker than access.

Anyway, go in to define database (option + shift + d) Double click your var1 field, go to the storage tab, choose "Use global (one value for all records)" -- this field will now behave like an actual variable (session specific, accessible from anywhere in the file etc.)

Now for your script just use:

Set Field[ var1 ; "" ]

Show Custom Dialog[] -- with the field var1 specified as the input field

Enter Find Mode[]

Set Field[ The Field That Var1 Is Meant To Represent ; yourtable::var1 ]

Perform Find[]

Link to comment
Share on other sites

Set Field [ PEP Jobs::var1="" ]

Show Custom Dialog [ Title: "Facilitator"; Message: "Enter the name of the Facilitator for which you wish to run this report"; Buttons: “OK”; Input #1: PEP Jobs::var1, "Facilitator:" ]

Enter Find Mode [ ]

Set Field [ PEP Jobs::Facilitator = PEP Jobs::var1 ]

Perform Find [ ] // The search is performed here -- after this you will automatically be taken into browse mode

Please explain this layout jumping here and then we can work out what's going wrong -- what layout do you start on? Why are there two layouts involved?;)

Go to Layout [ “Job Summary” (PEP Jobs) ]

Pause/Resume Script [ Indefinitely ]

Go to Layout [ “PEP Jobs” (PEP Jobs) ]

Edited by Guest
Link to comment
Share on other sites

  • 3 weeks later...

Sorry i forgot about this post

Anywho, in the attached there is a script called "find facilitator" and a giant button that you can't miss. There's a few things i wouldn't usually put in there i.e. excessive dialogs but it shows you a few techniques you might use.


Link to comment
Share on other sites

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