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 a find with an omit

Featured Replies

I need to make a Find script that allows the user to enter 1 item "Widgets" then is returned all widgets that are not discontinued. If there are no items found, the script displays the widgets that are discontinued. I am trying to avoid having users have to sort through discontinued items every time they do a find, but still be able to find the discontinued items if needed.

I tried the following, but I just can't get it to display what I want. Can anyone help?

# "omits records with "Discontinued" in Product Status field"

Enter Find Mode [ Request 1 (Omit): Productstatus Discontinued ]

[ Restore find requests ]

# "User enters find criteria"

Enter Find Mode

[ Pause ]

Perform Find

[ Constrain Found Set ]

Pause/Resume Script [ ]

If [ Status(CurrentFoundCount) > 0 ]

Else

If [ Status(CurrentFoundCount)=0 ]

# "None are found, then we need to include the discontinued items without pause."

# "Here we need to find on the user's criteria again without omitting the discontinued items."

Modify Last Find

If [ Status(CurrentFoundCount)=0 ]

Show Message [ Buttons: "OK", "", ""; Data: "No records match this request." ]

End If

End If

End If

Go to Layout [ original layout ]

Sort [ Sort Order: Manufacturer (Ascending)Model (Ascending) ]

[ Restore sort order, No dialog ]

You don't need to Enter Find Mode twice. Don't use Restore on the Enter Find Mode step; add a step after the user enters criteria to create a new request, set the Product Status field, and omit. Don't Pause/Resume after the Perform Find step, as there's no need for it. Delete the omitted request after modifying the last find. In summary,

Allow User Abort [Off]

Set Error Capture [On]

# "User enters find criteria"

Enter Find Mode [Pause]

# "omits records with "Discontinued" in Product Status field"

New Record/Request

Set Field [Product Status, "Discontinued"]

Omit Record

Perform Find [Constrain Found Set]

If [not Status(CurrentFoundCount)]

# "None are found, then we need to include the discontinued items without pause."

# "Here we need to find on the user's criteria again without omitting the discontinued items."

Modify Last Find

Go to Record/Request/Page [Last]

Delete Record/Request [No dialog]

Perform Find [Constrain Found Set]

If [not Status(CurrentFoundCount)]

Show Message ["No records match this request."]

Show All Records

End If

End If

Go to Layout [ original layout ]

#Don't sort if no matching records were found, i.e. all records were shown

If [status(CurrentFoundCount) <> Status(CurrentRecordCount)]

Sort [sort Order: Manufacturer (Ascending)Model (Ascending)] [Restore sort order, No dialog]

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.