Wayne0412 Posted March 2, 2011 Posted March 2, 2011 Hello again, I know it is possible (in theory) to pass user entered info into a script, and I have trailed these posts to try to see if I could work it out for myself, but I have hit a snag. I understand the concept, but when it comes to actually writing the script, I fail misserably. The first... I have a main page that has a field "Path For Excel Files" then a text box so the user can enter the path name before he/she performs the Import (see "Excel Path Input Field" attachment). I need this text to be passed to the Import Record Script so the script goes straight to the specific folder so the user can select the appropriate Excel file to Import (see "Import Records Scrip" attached). I know I could type in the path name myself into the script, and have it go there, but this solution will ultimately be distributed to various branches, and there is no guarantee that they will all save the Excel file to the same place. The second... Similarly, I have a few scripts that define a search criteria based on a minimum job value (see "Large Jobs Screen Shot" attached). Each branch has a different minimum value for reporting purposes, so I need the user to tell the script it's parametres. I have attached a screen shot of the main page Navigation to give you an idea of the overall look of the thing. BTW, I am running FMP10 Advanced. Again, I am forever in your debt for sharing your knowledge (and patience) with us newbies and dopes. Cheers
Wayne0412 Posted March 4, 2011 Author Posted March 4, 2011 Hiya, Can I assume that because there have been no replies to this post that it is not possible? Cheers
comment Posted March 5, 2011 Posted March 5, 2011 It would be safer to assume the questions are not clear... Passing data to a script is fairly trivial: scripts can read data from fields, variables and the script parameter. However, I don't know of a way to tell Filemaker to open up the import dialog at a specified folder. Re #2, I am afraid I didn't understand the problem at all.
Wayne0412 Posted March 5, 2011 Author Posted March 5, 2011 Thank you for your reply. I can get around the first part, but I would still like to investigate the second part. I'll try to explain it a little better. I have a custom dialouge box that asks the user to enter a value. I want that value to be passed into a "Find Request" as the Criteria. Here is how I think it should go (please see "Find Request Screen Shot" attached)... The user enters $5000 into the Custom Dialogue Box. That value populates the "Minimum Value" field. In the find Request pop up, I Select "Find Records" in the "Action" drop down, Select "Order Total" as the field in the "Find Records When:" pane, and put =>"Minimum Value" in the "Criteria" pane. This does not work. It puts the text in as the criteria when I perform the search, rather than the dollar value as entered by the user in the Custom Dialouge Box. (See "Search Error Screen Shot" attached) I am sure (at least I hope) there is a way to have user input entered via a dialogue box into a search criteria, but for the life of me I can not see how. I hope this explains my dilemma a little better, and I hope you can help me. Thank you again for your expertise, and I hope that my previous post did not pee you off, it was certainly not my intention. Cheers
comment Posted March 5, 2011 Posted March 5, 2011 Stored find requests are static - you cannot enter a field name as the criteria. Try something like: Show Custom Dialog [ YourTable::gMinimumValue ] Enter Find Mode [] Set Field [ YourTable::Value ; "≥" & YourTable::gMinimumValue ] Perform Find [] This assumes gMinimumValue is a global field. Alternatively, you could do: Enter Find Mode [] Show Custom Dialog [ YourTable::Value ] Set Field [ YourTable::Value ; "≥" & YourTable::Value ] Perform Find [] and save a field. I hope that my previous post did not pee you off Not at all.
Wayne0412 Posted March 5, 2011 Author Posted March 5, 2011 You are a genius, thank you so much. It is 4:20 am here in Australia at the moment, and I have been working on this (and a few other issues) since about 9 pm last night. You have saved my sanity and my relationship. BTW, option one worked perfectly first time. Thanks again.
Recommended Posts
This topic is 5012 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