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.

I need a layout to only show particular records.

Featured Replies

I need a particular layout to only show records that match a certain criteria.

Is there a way to run a script whenever a layout is viewed? That would do the trick.

I am new to FM but I am proficient in SQL and very comfortable with writing various types of code if that helps my options at all.

Any suggestions?

Thanks a bunch.

-wald

There are a few ways of doing this, but to see the best way I need more information please!

For example you could use a “self relationship” and a portal, or an automatic find set into a script that also goes to that layout. Tell me why, and what you want to do with the information when its shown, and I’ll try to help.

Rigsby

  • Author

Hey

The database I am creating is for an artist studio. We manufacture metal art. The database tracks orders and pieces as they are in the production process.

The layout in question is a daily production list. It needs to show all the orders which have a value of "not made" in the order_status field, sorted according to the date the order was placed.

This allows us to make sure we are making orders in a first come first served basis. I obviously also need to filter out all the orders which have already been made.

Thanks for your help Rigsby

-wald

RE: Is there a way to run a script whenever a layout is viewed? That would do the trick.

Why not run the script and then switch to the layout? The button should have name "Layout for Processing" or something like that.

wald -

You've described a portal, including some of the options. Now you just need to make a couple more choices and go build the thing. It sounds like you only need a script if you want to keep this portal out of view and automate the actions needed to view it.

To build the portal:

Define a global field "g_Undone", text, and enter the value "not done".

Define a relationship, g_Undone x order_status. (Define it in the file where the portal will display; this can be in the same file as the orders or another file.) Check the box for "Sort related records" and specify the order date field, ascending order.

Finally, draw your portal and add the appropriate fields.

There are options to how you do this. If the global field can be changed by the user, the contents of the portal can be made to change, thus displaying other subsets of records as desired. If you use a "1" instead of "not made", you'll conserve disk space. And so on.

If you would rather not view the records in a portal, you could use the same relationship as above plus a "go to related records" step, in which case the sorting would have to be handled by a script.

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.