Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Newbies

Hi, I'm very new to Filemaker Pro, and am just writing my first basic scripts for a project.  With a button,  I'm trying to filter my results to show me the records from the current week of the year.  My records are set up with a "Week" field that auto enters the current week number when new records are created. 

 

Now I want to have a button that shows me all the records from the current week and then display them on another layout.  I have this script working properly if I specify the week number in the Find request step, but I can't figure out the syntax to make it compare the current week number with the "Week" field in the records

 

Thanks in advance. 

 

Dana

Button script:

 

Go to Layout ["YourDisplayLayout"]

Enter Find Mode

Set Field[YourTable::Week; WeekOfYear(Get(CurrentDate))]

Perform Find

Read about "Finding Ranges of Information

 

To find a week of information, you will need to know what constitutes your week. Do you want Sunday thru Saturday, or are you looking for 7 days prior to today? 

 

Take a look at this custom function by Ocean West that you can find at Brian Dunning's site MagicDates

 

Lee

  • 1 year later...
  • Newbies

Lee,

 

Another newbie with a question about this older post... I've looked at the magicdates custom function. I'm curious how one would use it in a script to find records; I imagine it would be similar to what Doughemi has outlined in his example above but I believe that some changes would be necessary. 

Any immediate thoughts?

 

TIA. 

Travelindude

I'm curious how one would use it in a script to find records
 
It really depends on your specific application; keep in mind that the function is designed to allow users to input a variety of text phrases instead of typing a date range. If your script is supposed to always find records of the current week, then using this function would be an unnecessary complication.
 

 

 

 

My records are set up with a "Week" field that auto enters the current week number when new records are created.

 

I was away when this thread started, otherwise I would have commented on this:

This is not a good method to record the week in which a record was created. And it's certainly not a good place to search for records that were created in a given week - because such search would find records that were created in week X of any year. In addition, there's a problem of weeks crossing the year boundary, which I won't go into now.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.