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.

Scripting: Sort By

Featured Replies

  • Newbies

I made a script called "Search for", the idea was to make a search that would allow the users to search for a list of results. Things like

Booked, Missed, CBRS, Dispute, Special, etc....

Everything is working fine, up until the point after where you click the option that you want to search for. It comes up with the menu and when you select "Booking" , it will search for "Booking", however it will only search "Apptresult" and it wont search the other 3 boxes "Apptresult2" or "Apptresult3" or "Apptresult4".

What i want it to do is search the 4 boxes and search for what ever is selected in the menu. I also want it to search the 4 boxes, just not the "Apptresult" boxes.

I have attached a Screen shot to show you the source code. Maybe someone can see what i have done wrong.

Search.jpg

Without actually seeing what you are trying to do, if you have various fields that you want to search a keyword for, you will have to have seperate find requests for each field taht you want.

In other words, take your find key word, "booking" and set it a global field.

Then

Enter Find Mode[]

Set [field1; gKeyword]

New Request

Set [field2; gKeyword]

New Request

Set [field3; gKeyword]

New Request

Set [field4; gKeyword]

I am not sure if this is what you wanted.

Perform Find []

  • Author
  • Newbies

Without actually seeing what you are trying to do, if you have various fields that you want to search a keyword for, you will have to have seperate find requests for each field taht you want.

In other words, take your find key word, "booking" and set it a global field.

Then

Enter Find Mode[]

Set [field1; gKeyword]

New Request

Set [field2; gKeyword]

New Request

Set [field3; gKeyword]

New Request

Set [field4; gKeyword]

I am not sure if this is what you wanted.

Perform Find []

I dont know how to do the Set [field1; gKeyword]. I can get it to set the field, however i cant do the end part the ; gKeyword.

gKeyword is a global text field. If you are using a valie list to select your choice, you can have it used on this global field.

If you are using some other means for the user to select their choice such as a button etc, then just set the glocal field to the value before entering find mode.

I have been looking for a way to develop a basic "OR" search as a script and thought this would be it. However, I cannot find the commands you have noted in FM 8 Adv. This is what I have (see attachment)and it doesn't work. What am I doing wrong? Is there a way to get user input during a find script? Thanks for your help.

Al

Or_search_script.pdf

There are two basic finds in FileMaker.

An "AND" and an "OR". an AND limits the found set to those records that meet ALL of the criteria you have entered on your Request. An OR will include all records meeting all of the Criteria any of the Requests. So, in a sense, your OR find can have one or more AND criteria in them.

To preform an "AND" find, you would enter all of the criteria on one form.

i.e.

enter find mode

Set Field (FieldA; "XYZ")

Set Field (FieldB' "ABC")

perform find

this would find ONLY records having XYZ in FieldA [color:red] and , ABC in FieldB.

To preform an "OR" find, you need to have a separate request for each variable. In other words, I want records with this in them, or I want records with that in them.

enter find mode

Set Field (FieldA: "XYZ)

New Record Request

Set Field (FieldB; 'ABC)

this will find all records with either XYZ in FieldA, OR with ABC in field B.

To work this into your own find script, just remember what you are want in your found set.

HTH

Lee

Edited by Guest

Hi Lee:

Thanks for the response and script suggestions.

Is there a script command to get user input and then continue to the next Set Field? I.E.

Set Field(lName:get(userinput)

New Record Request

Set Field(lName:get(userinput)

Where New Record request is a variable number (I guess a loop) Then perform the find?

Additionally, I often have a need to look for several contacts OR companies or several contacts AND several companies in the same search, so my OR searches are usually pretty simple

Find

LastName = a

OR

LastName = b

OR

LastName = c

Sometimes

LastName = a

OR

LastName = b

OR

LastName = c

AND

CompanyName = A

OR

CompanyName = B

OR

CompanyName = c

So my search is not

LastName = a

AND Company = A

Can this be accomplished in a script requiring user input? I feel this would be a lot easier then having to teach all users the nuances of AND and OR searches and their combinations.

Thanks for your input.

Al

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.