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.

Passing parameters (arguments) between scripts

Featured Replies

I need to perform an external script and I need to pass it some parameters (arguments).

What I do is:

1. write the parameter in a global field TEMP_A

2. copy to the clipboard the global field's content

3. performing the external scipt.

The external script pastes the parameter in a global field TEMP_B

then access the data and performs.

It works, but it seem to me a very inelegant procedure (a hack). It comes difficult to pass several parameters and the user loses the content of the clipboard.

Another solution is to use a specific file for storing parameters. Access to parameters is achieved trought relationships.

This work but it is a very complicated way do to something very simple..

Just forget about the copy/paste part, and use a relationship to get them. They're in global fields so it doesn't matter which records relate, or even if any records relate at all.

For example, if I have a clients database and an invoices database, and I want to invoice a client:

Clients

Set field, globalClientNumber, clientNumber

Perform script, External, new invoice from clients

Invoices

Script: New Invoice from clients

New record

Set field, clientNumber, Clients::globalClientNumber

Invoices must have a relationship to cients, but it need not have related records from the current record, so you might as well use the clientNumber field since you may use this relationship for other things like "show client file" from the invoice.

Of course it doesn't matter which file you have the globals in, I could just as well have used a global field in invoices.

  • Author

First of all, thank you for your reply.

But suppose the solution is multi-user.

What happen if two users invoice a client simultaneously ? Or (more general) what happens if two scripts that uses the same global in a related file are performed at the same time ?

Scripts are performed on the user machine so one script may start before another (from another user, who access the same global) has finished. May they interfere each other ?

Again, thank you.

Paolo.

Global fields' values are actually local to each user, so they can't interfere with each other. Filemaker's use of the term 'Global' is very misleading.

Well..... Yes & No.

Global is local to each user but Global to every record (in that database).

I know. A technicality.

I've written a plugin for exactly this purpose. Any number of parameters may be passed and returned, within scripts of the same file or across files. It's Mac & Windows compatible. There is a small syntax learning curve, but well worth the effort. It is documented, with examples, and a sample file for downloading.

The plugin enabled me to do things not possible with relationships to globals, which can get quite messy and unmaintainable for anything but the simplest examples. I wrote and deployed it for use in a commercial product, so it's solid and reliable, with thousands of commercial customers unaware of its use. It is now available as shareware.

Check out 'Jazz Params' at www.jazzmedia.com.au

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.