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.

filtering records on a layout

Featured Replies

Hi Guys,

 

I'm sure this must be fairly simple, but I am a FM noob. I have a layout which includes a date field and a portal of related records. What I would like to do is have two date pickers in the header of my layout - one for a FROM date and one for a TO date. I would like to then only show records that fall between those two dates. 

 

How would that be possible please?

 

1. Make sure that your date picker fields are global fields.

 

2.  Make the relationship for the portal

 

YourTable::FromDate ≤ RelatedTable::Date

YourTable::ToDate ≥ RelatedTable::Date

doughemi provided you a solution that would filter the portal (child) rows via the relationship.

You could also set the portal to filter the child rows based on the contents of the globals that doughemi suggested.

 

What is NOT clear from your posting is what data you want to isolate and where the data is located.

if you want to isolate the parents (non portal records) based on the content of the date field and the date field is a parent table field you could simply perform a find on the date field as startdate...enddate where the startdate and enddate values are entered while in find mode. ref the find operators in the FM help file.

This find could also be scripted to leverage the globals that doughemi mentioned.

 

Precise questions = precise answers

  • Author

thanks for the help so far - Ok I guess what what I was angling at was asking if it is possible to have two controls on my form that are unbound that can form the basis of my search. I cant see why I would need to create a global fields for two controls that are effectively orphan. (i.e. they don't need to bind to anything because they are just allowing a value to be selected and then for that value to be parsed as a query parameter).

 

Based on doughemi's answer I am guessing this is against the relationship based and tightly bound principles of FM. Which is fair enough lol.

 

 I will give the global fields a go. thank you for the suggestion.

 

One further thing if I may, can I add any logic to say that if any row on the main table my layout relates to has NO rows returned in the one portal included on the layout, omit it from displaying.

 

Many thanks

Select the portal. In the Inspector, go to the Data tab, and under "Behavior" enter Count(YourPortalTable::SomeAlwaysPopulatedField) = 0 in the "Hide object when" field.

Create an account or sign in to comment

Important Information

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

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.