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.

Set Field in a Scripted Find

Featured Replies

I may not have understood the problems that are similar and/or the solutions described, so forgive me if this is repetitive. I am using FM8 Advanced. I have a script that seems to work but it only works on one group of several identical groups, time after time after time. I am trying to produce a monthly summary report of attendance at several of our schools. I am using a Get(Scriptparameter) function with buttons so that any month can be printed whenever desired. The script is pretty standard except for the Find section. It reurns the correct result for one school and the same school repeatedly. What I want is the correct result for all the schools on the same report.

The find script section looks like this:

Enter Find Mode []

Set Field [AttendanceTO::gMonth; Get (ScriptParameter )

Set Field [ Case(AttendanceTO::gMonth = "A"; AttendanceTO::DateEnter <7/23/2005 and AttendanceTO::DateExit = "" ;

AttendanceTO::gMonth = "B"; AttendanceTO:}:( DateEnter <8/30/2005 and AttendanceTO::DateExit >7/23/2005;

(and so on for a total of 14 months)

Perform Find []

I have made sure that the "restore" capabilites of the Enter Find Mode and Perform Find are empty. I've made sure that all the records in the database are present. But everytime I run this script I get the monthly data for this one school on my report. The data is all summary data and is contained in a Summary Part on the Layout. It sure looks like I'm missing something here, aren't I?

Thanks for the help.

I missed where you are sorting by the break field? Have you tried sorting the records by your break field, then going into preview mode?

  • Author

Hi Breezer,

Yes, I sort on; Schools::SchoolName ...but only that one school prints out.

Veronica

The find script section looks like this:

Enter Find Mode []

Set Field [AttendanceTO::gMonth; Get (ScriptParameter )

Set Field [ Case(AttendanceTO::gMonth = "A"; AttendanceTO::DateEnter <7/23/2005 and AttendanceTO::DateExit = "" ;

AttendanceTO::gMonth = "B"; AttendanceTO:}:( DateEnter <8/30/2005 and AttendanceTO::DateExit >7/23/2005;

(and so on for a total of 14 months)

Perform Find []

This doesn't quite make sense. There's no need to set a global (gMonth) here, as you can access the script parameter at any time. But more importantly, the second Set Field[] does not have a target field set. Was this an oversight in transcription, or don't you have a target field set? Or perhaps the problem is with the date format in that calc. Remember, in calcs, literal dates should be referenced using the Date() function.

If I am deciphering this correctly, you need to do something like:

Enter Find Mode []

# SET DATE ENTER CRITERIA

Set Field [ AttendanceTO::DateEnter ; Case ( Get (ScriptParameter ) = "A"; "<" & Date ( 7 ; 23 ; 2005 ) ; Get (ScriptParameter ) = "B"; "<" & Date ( 8 ; 30 ; 2005 ) ; ... (and so on for a total of 14 months) ]

# SET DATE EXIT CRITERIA

Set Field [ AttendanceTO::DateExit ; Case ( Get (ScriptParameter ) = "B"; ">" & Date ( 7 ; 23 ; 2005 ) ; ... (and so on for a total of 14 months) ]

#

Perform Find []

  • Author

Mr.s Comment & Ender

Thank you for your time and effort. I tried the calculation Mr. Comment provided and it worked on the nominal testing I've done so far, (other priorities you know). Ender you've helped me before and your comments always help me see the problems in a different way, which has always been to my benefit. Thank you both.

Hi Veronica,

Are you in your Schools table? It sounds like it. But don't you want to summarize attendance? What is the table occurrence of your report? It sounds like you're in your school table searching your related attendance fields - I think your report should be in attendance which would produce all schools and not just one. :wink2:

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.