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

Date Range

Featured Replies

  • Newbies

I am working on a script to find all call back dates after 01/01/2009 and todays date

Here is the script

Enter Browse Mode

Show all records

Enter find mode

Go to field (People::Call Contact)

Insert Calculated results [

People::Call Contact=(Date ( 01 ; 01 ; 2009)..Date ( 12; 31 ; 2009 ) )

What do I have to use here?

The Enter Browse Mode and Show All Records aren't necessary before a find. I would also suggest you use a global date field (or two) to hold your dates instead of hard-coding them within your script. It is also highly recommended that you use Set Field[] instead of Insert Calculated Result[] ... Set Field[] is always the better choice because it doesn't require the field be on the layout. Set Field[] also doesn't require that you Go To Field.

So globals gFrom and gTo are on a layout for User to enter their information then button runs following script:

If [ not ( gFrom ) or not ( gTo ) ]

Show Custom Dialog [ OK ; "One of your date range fields are empty. Try again." ]

Halt Script

End If

Go to Layout [ layout based upon People table ]

Enter Find Mode [ uncheck pause ]

Set Field [ People::Call Contact ; gFrom & ".." & gTo ]

Set Error Capture [ On ]

Perform Find [ ]

If [ not Get ( FoundCount ) ]

Show Custom Dialog [ OK ; "No records found." ]

Go to Layout [ Original Layout ]

Exit Script

Else

... do whatever you wish with your found set of People

End If

:smile2:

You don't need to Show all records, the Find will search all records anyway.

You should read about the Finding ranges of information which can be found in the User Guide, and the Online Help when FileMaker is open also here Link

Note the Equal to and Greater Than

Lee

  • 3 months later...

I can't believe I was so sloppy in this first line of script ...

If [ not ( gFrom ) or not ( gTo ) ]

Why I put parentheses around the fields is beyond me; I must have been quite tired. The step should only be:

If [ not gFrom or not gTo ]

I dislike the fact that someone new might read this and perpetuate inefficient or junkie process and I apologize for my error. Please do not use needless quotes. :crazy2:

I'd have done that a bit differently, made the purpose more explicit...

If [ isempty( gFrom ) or isempty( gTo ) ]

...but I'm funny that way.

Hi Vaughan, I believe we should pass on using true Boolean logic whenever we can. It is more efficient and truly, Boolean is understood in all programming languages. If someone understands Boolean then my example is just as explicit and easy to understand.

If those in FileMaker don't understand it then they need to learn. :wink2:

Edited by Guest

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.