Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Export Field Contents - Variable

Featured Replies

I have a button on a portal that calls a script "Show_Container": 

Line 1:   Set Variable [ $Param ; Value: Get ( ScriptParameter ) ]        (name of container field is passed thru script parameter)

Line 2:   Set Variable [ $Path ; Value: Get ( TemporaryPath ) & GetContainerAttribute ( $Param ; "Filename" ) ]

Line 3:   Export Field Contents [ Table::Field ; ""$Path"" ; Automatically open ]

 

Wanting to reuse this script in multiple places, I need to be able to replace the "Table::Field" in line three with a variable, but can't see how to accomplish this.

Any ideas?

Thanks,

John

 

 

Edited by Woodeye

Before looking for a solution to the problem as presented, I would ask why this problem exists in the first place. To me, it sounds like you have multiple fields where you should have multiple records in a related table.

  • Author

I could easily rewrite the script for each layout/table it would be used in (the script is only 3 lines). What I am trying to do is get better at writing reusable scripts. In this case, I don't see how I can do this.

 

You're not answering my question: the fact that you want this script to be reusable indicates a structural issue. It will be easier to solve the structural issue than to make this script reusable - not to mention that the structural issue will remain to cause you many other problems.

The target field of Export Field Contents[] cannot be parametrized. The only way to make this work the way you describe is to make sure that the required field is the currently active field - then use Export Field Contents[] without specifying the target field. You can make the required field active by looping among all fields in the layout's tab order until the active field's name is equal to the script parameter. Or give the field an object name and use Go to Object[] to make it active. Both are hacks designed to work around the real problem. And, IMHO, so is the solution linked to by @webko.

I'm not sure it has to be a structural issue - I can think of a number of scenarios where I have container fields in different tables that I would like to Export - having one script to perform that function, rather then one for each Container field seems logical to me...

  • Author

I am obviously not only a failure at FileMaker, as I should have thought of using a global field. I am now conflicted as to whether to sign up for training in FileMaker or have someone teach me to use a Google search properly. 

Thank you for the help.

Hi Woodeye, and welcome to the FMForums,

I posted a couple of links to training sites the other day here. 

 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.