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.

Basic If, Else If Script

Featured Replies

I am trying to use a notes separator script in several different notes fields throughout the database. I would like to use If, Else If script to allow the script to be written only once. Here is what I've got. New to databases. Any help?

If [FieldType ("Test.fp7" ; "Customer::Notes")]

Go to Field [Layout::Notes]

Else If [FieldType ("Test.fp7" ; "Service::Notes")]

Go to Field [service::Notes]

Set Selection [start Position: 0; End Position; 0]

Insert Text [" "]

Set Selection [start Position: 0; End Position; 0]

Insert Calculated Result [misc. formula]

End If

Where does the Else fit in? I've tried various spots and just can't get it to work. Thanks.

Take a look at this video:

http://www.filemakermagazine.com/articles/methods-for-taking-notes.html

  • Author

Neat technique, but I'm still learning the basics first. So if anyone could help on the If, and Else if.

Edited by Guest

There's nothing wrong (that I can see) with the way you are using If[] and Else If[]. The problem is with the FieldType() function, which doesn't do what you think it does. I suspect you want to test the current layout's name - if so, use the Get (LayoutName) function.

What sort of help are you looking for? You have a script. Does it do what you want it to?

You need an If[] and End If to make an If[] statement. Else If[] and Else are optional. Else is the same same Else If[1], and it means, "if none of the previous tests succeed do this instead." No Else If[] or Else used after an Else will ever get tested.

I'd leverage script parameters instead of relying on the current field. Parameters are optional strings passed to the script. you can set them when defining your button (among other places).

On your Customer button, pass the parameter "Customer". Then on your script:

Set Variable[$type = Get(ScriptParameter)]

If[$type = "Customer"]

do this

Else If [$type = "Service"]

Do this

End If

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.