September 27, 201312 yr I have my database currently corted by (effective date) jan-dec and also by a month sort calculation that separates these dates into months. When a user enters this layout the script automatically runs and sorts accordingly. I'd like for filemaker to scroll to the top of the current month say September, so the user immediately sees all current accounts. What calculation would I use? I've tried the get current date function and all it scrolls to is a date in april. Any help is greatly appreciated. Thanks! Matt
September 27, 201312 yr How about … # ... your sort routine Go to Record … [ Last ] // unless that's already done Set Variable ( $cm ; Month ( Get ( CurrentDate ) ) ] If [ table::matthewsMonthSortCalculationField = $cm ] // otherwise there are no entries for the current month, and the rest is moot Loop Go to Record … [ Previous ] Set Variable ( $overShot ; table::matthewsMonthSortCalculationField < $cm ] Exit Loop if [ $overShot or Get ( RecordNumber ) = 1 ] End Loop If ( $overShot ) Go to Record [ Next ] End If End If This assumes that matthewsMonthSortCalculationField is defined as Month ( datefield ). Haven't tested this live, so no warranties whatsoever …
September 27, 201312 yr Author I've attached my current sort order and a picture of my database for reference. Thanks! Matt 2.tiff 1.tiff
September 27, 201312 yr OK, so you have a summary layout sorted by month, date, last name and whatnot; then what is "Go to Portal Row" doing in the script? Anyway … if your month field is the month number (is it?), then you could simply append the code I wrote above to your script, and it should work (sans Go to Portal Row, to be sure …); assuming it is correct in the first place, that is …
Create an account or sign in to comment