August 30, 20214 yr Hello! I have written scripts to download when the button is clicked that it will download the file associated with that button. HOWEVER, is there a simple way to write a script to simple download the file associated with a button pushed, instead of writing a script for each button, will be over 50!!! A user can only click on button at a time, and each button has its own container field. I put a screen shot of the menu they will see, and a copy of the script I am using per button. Could I just have a general script to start once the button is pushed to get the name of the button and then download that file associated with it????? Thanks a million!!!
August 30, 20214 yr I would suggest you place the files in a related table, where each one will be an individual record. Then show them in a portal (or, going by your screenshots, in portals). Then your script, when called by a button placed in a portal, will export the field of the record shown in that portal row. I believe you will find this structure more convenient for other purposes as well.
August 30, 20214 yr Author I would rather keep them in this table, since that is basically what it is. All this FM database does is lets one person upload files from one layout and then other people download files from another layout. I would like to capture the name of the button they click on, and then from there download the file associated with it. I am wondering if the Get ( ActiveFieldTableName ) would work?
August 30, 20214 yr 22 minutes ago, 1FilemakerMan said: I would like to capture the name of the button they click on When you say the name of the button, you actually mean the label of the button - do you not?
August 30, 20214 yr Author 39 minutes ago, comment said: When you say the name of the button, you actually mean the label of the button - do you not? Button or label. They will be clicking one of the four Container Buttons to download the item. I am fooling around with something like this right now. But it is not seeing the object in the container field to download. It just creates a text file.
August 30, 20214 yr Author There has to be a simple way that on click it simply starts to download the contents of the "Container Field" clicked on.
August 30, 20214 yr 3 minutes ago, 1FilemakerMan said: There has to be a simple way that on click it simply starts to download the contents of the "Container Field" clicked on. No, there is not. And there is a good reason why there isn't. Filemaker is a relational database. Having 50 "alike" fields violates database normalization. Filemaker does offer you a simple way to accomplish your goal by using records instead of fields - as I already suggested in my first reply. To do it with 50 fields, you will need 50 scripts. Or assign each button a script parameter and add 50 If[] steps to your script. Note that you could use an OnObjectEnter script trigger instead of making the field a button. But that would be sub-standard UI. And letting users into the field, even for a short instant, could have undesirable side effects.
August 30, 20214 yr Author Ok, will I think I will look into doing it the way you suggested. I could then display the fields in a related table try it that way. You are very much way better at this program than I will ever be. I will work on moving things over to another table.
Create an account or sign in to comment