Matthew R White Posted September 27, 2013 Posted September 27, 2013 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
eos Posted September 27, 2013 Posted September 27, 2013 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 …
Matthew R White Posted September 27, 2013 Author Posted September 27, 2013 I've attached my current sort order and a picture of my database for reference. Thanks! Matt 2.tiff 1.tiff
eos Posted September 27, 2013 Posted September 27, 2013 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 …
Recommended Posts
This topic is 4073 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