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.

Scripting a Find with both a global Date Range and Omit Criteria

Featured Replies

I want a script that will allow me to produce a specific field criteria within a user defined date range.  I'm getting hung up... any suggestions would be greatly appreciated. Below is a sample of the script:

 

If[isEmpty(TableName::gDateStart)]

Show Custom Dialog ["Start Date must have a value. Please enter"]

Exit Script []

End If

 

If[isEmpty(TableName::gDateEnd)]

Show Custom Dialog ["End Date must have a value. Please enter"]

Exit Script []

 

If[TableName::gDateEnd < TableName::gDateStart)]

Show Custom Dialog ["InvalidEndDate"; "End Date cannot occur before Start Date. Please reenter"]

Exit Script []

End If

Go to Layout [LayoutName]

Enter Find Mode []

Set Field [TableName::DateStart; TableName::gDateStart &"..."&TableName::gDateEnd]

Perform Find

 

All of the above works fine...  Producing the correct results within the specified date range (and warns the enduser if they neglect to enter one of the required dates or they they enter an end date lower then the Start date).

 

But how would I modify this script if I also wanted a specific field criteria to be omitted from my result?  Another words, I want to omit the records where TableName::ParticipantStatus = "Child" (AND all of the records should still fall within the user identified date range).

 

Any help would be greatly appreciated.  Thank you.  

 

 

IAnother words, I want to omit the records where TableName::ParticipantStatus = "Child" (AND all of the records should still fall within the user identified date range).

It would look like this:

 

Enter Find Mode [ pause for user ] ... user or first specificied of date range or whatever

New Record/Request

Set Field [ TableName::ParticipantStatus ; "Child" ]

Omit Record

Perform Find [  ]

By the way, most Users like the ability to leave start date empty (meaning include all dates prior to end date) or leave end date empty (meaning all dates greater than or equal to start date). And surprisingly this is a valid range search. ...31/12/2004 or even 1/1/2012...

FM - if no value on the left of the ellipses - assumes all prior values and reverse for the other side. So if this business rule is acceptable then you can skip the tests for empty globals or if large data sets you might want to warn if BOTH were empty such as Count ( gStartDate ; gEndDate ) = 2 // means both lack dates.

But the one-sided range search tickles me. It feels elegant and efficient (if that is what you want anyway). If you have end number which might ever be decimal be sure to use 3 ellipses though or FM will misinterpret and see 2 ellipses with decimal as 3 ellipses with whole number.

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.