Jump to content

filtering records on a layout


bruceiow
 Share

This topic is 2880 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2880 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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