Newbies Michael Scruse Posted November 30, 2006 Newbies Posted November 30, 2006 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.
Genx Posted November 30, 2006 Posted November 30, 2006 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 Michael Scruse Posted November 30, 2006 Author Newbies Posted November 30, 2006 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
Genx Posted November 30, 2006 Posted November 30, 2006 (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 November 30, 2006 by Guest
Newbies Michael Scruse Posted December 4, 2006 Author Newbies Posted December 4, 2006 Hi. Thanks for your continued help. The layout that I start on is called "PEP Jobs" which is the main layout that we work from. The other layouts are various "reports". I have attached a copy of the file so you can have a look. thanks Michael. Pep_Projects.fp7.zip
Genx Posted December 21, 2006 Posted December 21, 2006 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
Newbies Michael Scruse Posted December 21, 2006 Author Newbies Posted December 21, 2006 Thank you very much for this. Works perfectly..
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now