Auraboros Posted March 8, 2016 Posted March 8, 2016 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
webko Posted March 8, 2016 Posted March 8, 2016 For this portal, create a global Date field on the Parent. Use that as the basis for the relationship to the Date field in the Child table...
Auraboros Posted March 8, 2016 Author Posted March 8, 2016 (edited) Thanks Webko...but where does the user enter the date he/she wants to find? Edited March 8, 2016 by Auraboros
RyanESmith7 Posted March 8, 2016 Posted March 8, 2016 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).
Auraboros Posted March 8, 2016 Author Posted March 8, 2016 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?
comment Posted March 8, 2016 Posted March 8, 2016 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. .
Recommended Posts
This topic is 3181 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 accountSign in
Already have an account? Sign in here.
Sign In Now