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.

A Script to find a Name with in a field of First N

Featured Replies

I have searched for help on this with no results. Using WINDOWS and FMP 6.0v4. Here is the situation: I have a data base with 419 records, and four fields: "Names", "Height", "Weight" and another named "Age".

Can you help write a script that will go to a specific layout, find all the people named John and sort the found results descending by age, ascending by height and ascending by weight?

Hmm - I have never worked with FM6, and am just starting back in with FM7, but here are some loose suggestions.

One way could be to write the script to pull the found set, then return a custom dialog. This dialg can be called something like 'Choose a sort method' and offer choices to sort by Age, Weight, etc.

Or do you mean that you want 1 found set sorthed by ALL the criteria you mention, in that order and direction?

Kurt

  • Author

I forgot to say In a novice. I would like (at a touch of a button) get 1 found set sorted by ALL the criteria I mentioned, in that order.

Hi and welcome to the Forums,

FM remembers your sort options, so :(

1. Create your script "SortwithMyCriteria" with dialog checked.

2. When the Sort dialog box opens, select your criterias, click Done

3. Perform your sort.

4. Reopen ScriptMaker, uncheck "dialog"

Your sort is saved for this script.

Now, create your Find script

Go To Layout "X"

Search Mode [Pause]

Perform Search

Perform Script ["SortwithMyCriteria"]

HTH

  • Author

Thanks Ugo DI LUCA:

I was able to

1. Create your script "SortwithMyCriteria" with dialog checked.

2. When the Sort dialog box opens, select your criterias, click Done

3. Perform your sort.

4. Reopen ScriptMaker, uncheck "dialog"

I can not create your Find script

1.Go To Layout "X"

2.Search Mode [Pause]

3.Perform Search

4.Perform Script ["SortwithMyCriteria"]

I can not locate where "Preform Search" is

I would like to seach specificly "John" within the "Name" field.

I will keep looking, but thought I would let you know were I am at.

Thanks

Hi again,

Sorry, not an English version I have here, but :(

Perform Search should read "Perform Find"

GoToLayout[Your Layout]

Enter Find Mode

Set Field [NameField, "John" ]

Perform Search

You need the field "Name" on the layout.

  • Author

This is still alittle different than what you had suggested for me to get my find Script-- I can:

GoToLayout[Layout#1]

Enter Find Mode (Restore)

Set Field ["Name"]

Perform Find/Replace ["John","", Find Next"]

However, this will NOT bring up the students named "John" that are in the "Name" field in the layout. I might be doing something wrong.

It's "Perform Find" under the "Found Sets" area. "Perform Find/Replace" is something else entirely.

That one tripped me up the first time I started playing with FM7. Took me a while to figure out that Perform Find moved, along with all the other Find/Sort/Print script steps.

Hi,

Without bringing too much confusion, you could also create a relationship matching "John", involving a global field for the left side and the Name field at right side.

Please update your profile as it shows 6 as the FM version you're using.

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.