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

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

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

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

This topic is 7974 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.