Jump to content

User Defined Date Portal Filter


Auraboros

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

Recommended Posts

Hi...

I have a portal with records that have a date field. I would like my users to be able to define a date that the portal will filter and show only records with the date the user defines. This seems simple, but I cannot figure it out.

If I use a filter that uses a calculation with Get(CurrentDate) it will work, but only for the current date! So I know my relationships etc. are working...but I would like to be able to choose the date in the user interface...and have the portal search and display that particular date (NOT a date range, just one date). I have tried to perform a find, but that doesn't work (I am new to FM!)

Any help? Thanks!!!

Todd

Link to comment
Share on other sites

As webko mentioned, put the global field on your parent table. Put the field to select that global on your parent layout (I usually put mine right about the portal that they are going to filter). Setup your filter in your portal settings. Also, setup a script trigger for OnObjectExit that will refresh your portal (using the "Refresh Portal" script step). 

Link to comment
Share on other sites

Duh...I figured it out...I think. Thanks Ryan....How about the match relationship? I had to relate the date field I wanted found in the portal set (child) to the global date field in the parent. Is that right? It would not work otherwise. My portal refreshed without any other script setting. In the portal filter I had the child date field = the parent global field. It seems to work, did I do it right?

Link to comment
Share on other sites

13 minutes ago, Auraboros said:

How about the match relationship? I had to relate the date field I wanted found in the portal set (child) to the global date field in the parent.

You can either filter the portal (using the existing relationship as is) or filter the relationship (in which case you would probably want to add a new relationship for this purpose). The discussion above mentions both and it seems you have intermixed the two techniques - which is not a good thing.

If the number of related items to be filtered is relatively small (say under 1,000), then filtering the portal should be quite sufficient. In such case you should leave the relationship as:

Parent::ParentID = Child::ParentID

only and not add another predicate to it. Filter only the portal by using the expression =

Parent::gDate = Child::Date

in the portal setup.

.

Link to comment
Share on other sites

This topic is 2943 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
×
×
  • Create New...

Important Information

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