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

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

Recommended Posts

Posted

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

Large Jobs Screen Shot.jpg

Main Page Navigation.jpg

Excel Path Input Field.jpg

Import Records Script.jpg

Posted

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.

Posted

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

Find Request Screen Shot.jpg

Search Error Screen Shot.jpg

Posted

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.

Posted

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.

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