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

Featured Replies

I love the ability to use script parameters in FMP7 -- simplifies many things. However one thing I wanted to be able to do is to easily get specific parameters, either by number of by name. With Developer's custom functions it was straightforward to write a function that gets a parameter by name:

Custom Function "ScriptParamByName(Name)":

//ParamPair is a mapping of a parameter to a value in the format "name: Value"

Evaluate(" Let([" & Substitute(Get(ScriptParameter);[":";"="]) & "]; "&name&" )" )

-------------------------------------------------

Calling a script with Parameters:

Note - it is helpful to list the paramNames in the Script name

Notice the parameter is constructed as "ParamName: Value"

Text has to be placed in escaped quotes

Perform Script["DisplayNames(Type; ID)"; Parameter: "Type: "Record"; ID: 422"]

-------------------------------------------------

Using the ParamName custom function in a script calculation

Script: DisplayNames(Type; ID)

Show Custom Dialog[scriptParamByName("Type")]

Show Custom Dialog[scriptParamByName("ID")]

-----------------------------------------

There may be some glitches -- but the general gist is there. People may wish to suggest improvements.

FileMaker Version: Dev 7

  • 7 months later...

Thanks for the How-To. I am going to use this technique, as keeping track of which word in the ScriptParameter is which parameter is driving me nuts (especially since FM considers the "-" a word boundary). I've modified your formula just a little to use a more classic command-line look, in the form of varname=value. It makes it easier for my eyes to pick up:

Custom Function

ScriptParamByName(param):

/* Takes argument param and extracts from ScriptParameter in form of */

Evaluate(" Let([" & Substitute(Get(ScriptParameter) ; ["=" ; "=""] ; [";" ; "";"]) & ""]; "&param&" )" )

All the rest is the same, except that you use a ScriptParameter like so: "Type=Record; ID=422"

HTH.

David

  • 3 weeks later...

I just noticed that my choice of terminology in my script causes Internet Explorer to mis-display my function (the ampersand combined with my variable name "param" gets converted to a paragraph mark and an "m". For those who are using IE, here is a modified version using "passvar" instead:

Evaluate(" Let([" & Substitute(Get(ScriptParameter) ; ["=" ; "=""] ; [";" ; "";"]) & ""]; " & passvar & " )" )

Create an account or sign in to comment

Important Information

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

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.