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

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

Recommended Posts

  • Newbies
Posted

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

thanks

Michael.

Posted

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[]

  • Newbies
Posted

Hi. Thanks for your prompt response. I have followed your instructions but it comes up now and says "No records match this set of find requests".

I have attached a copy of the script for your reference.

Many thanks

Michael.

Script.pdf

Posted (edited)

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
  • 3 weeks later...
Posted

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.

Pep_Projects.zip

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