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.

1st time scripter

Featured Replies

I'm trying to create a script that does something fairly simple. At least I think it is simple.

I want to find all records with the field "Buddy" set to "Yes"

And omit all records that have the field "Status" set to "Inactive"

Any help would be appreciated.

-Kirk

Enter Find Mode ()

Set Field (Buddy, "Yes")

New Record/Request

Toggle Status Area (show) <-- not required in newer versions of FM

Set Field (Status, "Inactive")

Omit

Perform Find ()

-bd

  • Author

I'm using FM6 on a Mac.

What do I put in the parathesis next to the the Perform Find?

Replace Found Set?

Constrain Found Set?

Extend Found Set?

Nothing. Script steps cannot be typed in, only selected from the menu in ScriptMaker. The empty parenthesis indicates that you should uncheck the "restore" option in both the Enter Find Mode and Perform Find steps. If you don't they will override the find you wish to perform with a saved find. Might want to read the manual a litte and play around with ScriptMaker. Doing so will make all of this more obvious.

-bd

  • Author

I have both unchecked, yet it still wants something in those paranthesis. Any thoughts? It's working with the Constrain in there.

Thanks for all your help, by the way.

What exactly do you mean by "wants something in those paranthesis"?

If you are referring to the Perform Find [] script step, you must choose "Replace", "Constrain" or "Extend". If you choose "Constrain" (or any other option) your only other possible choice is to check the "Restore find requests" checkbox or not. No other parameter can be entered.

Replace: replaces the current found set with the results of the find

Constrain: performs the find on the current found set, further constraining the results

Extend: performs the find on the records not in the current found set and adds the results of the find to the found set

-bd

  • Author

Okay, this is what I'm trying to say.

Your original script had it like this:

Perform Find ()

What I was saying was that I couldn't figure out how to have nothing inbetween those paranthesis.

A little too much pre FM 6 shorthand on my part. Since FM 6 you must select one of the found set options, but still need to uncheck "restore".

-bd

  • Newbies

Is it possible to write something that would pull out the first part of the word? Like for Buddy maybe just Bud?

Yes it is.

Left("Buddy", 3) will give you the result "Bud".

Left(YourField, 3) will give you the first three characters of whatever is in the YourField field.

Cheers

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.