May 16, 200619 yr Newbies Greetings, This one should be simple, and yet... What I would like to do is a button that resets the date fields I use to filter the data displayed in a portal to the minimum and maximum date values of the table, so that all entries are visible and so that I can know what the date range is. I tried this: (btw the Filter fields are global of course) Go to layout ["LayoutName"(TableName)] Show all records Set Field [OtherTableName::FilterFromDate; Min(TableName::Date)] Set Field [OtherTableName::FilterToDate; Max(TableName::Date)] Go to layout [Original Layout] ...but it sets the filter fields to the active record's date instead of the minimum of the whole table! Am I wrong or is there a way to do it without scanning every record through a script? Thanks
May 16, 200619 yr Author Newbies Nevermind, I figured out! (I added a summary (minimum) field to the table)... I knew it would be simple. Sorry for wasting your time :P
May 16, 200619 yr You could do this without any extra fields by sorting the records by date, going to the first record, setting the minimum, and going to the last record to set the maximum. Or, stay in the Parent layout and do only this: Set Field [ Parent::FilterFromDate ; Date ( 1 ; 1 ; 1 ) ] Set Field [ Parent::FilterToDate ; Date ( 12 ; 31 ; 4000 ) ] Set Field [ Parent::FilterFromDate ; Min(Child::Date) ] Set Field [ Parent::FilterToDate ; Max(Child::Date) ]
Create an account or sign in to comment