November 30, 200619 yr 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). thanks Michael.
November 30, 200619 yr 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[]
November 30, 200619 yr Author Newbies 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
November 30, 200619 yr 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, 200619 yr by Guest
December 4, 200619 yr Author Newbies 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
December 21, 200619 yr 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
Create an account or sign in to comment