Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted
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 …
Posted

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 …

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 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.