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

Hi,

I have a field to count the number of records between certain date in calculation:

ExecuteSQL ( "Select Count(*) FROM Order2 WHERE DueDate BETWEEN WeekStartDate AND WeekEndDate AND Decoration = 'Digital'"; ""; "")

It works the first time but it cannot refresh in the field when there are changes.  Is there anything I can do to refresh it?  Thanks.

KC

If the field is unstored then it will be refreshed every time FM has to display it or otherwise reference it.

However; this is a classic case of where you would NOT want this to be a calculation and certainly not an unstored one.  If this calc fires when the record is not committed yet, it will be a very expensive operation since FMS will send the whole table down to the client to resolve that calculation.

If you have not seen that behavior in action yet, download the performance test file from my 2014 devcon presentation: https://www.soliantconsulting.com/blog/executesql-named-buckets/

 

To add to what @Wim Decorte said:

If you want/need this to be an unstored calculation, then use native Filemaker methods (e.g. an auxiliary relationship to filter the records to count, and the Count() function to count them) instead of SQL.

 

And to add one more option: if the underlying changes are part of a scripted workflow: set the count field as part of those scripts so that there is no slowness if you need to use it in reports.

Usually that is the approach with the most work vs. just relying on a field-level calc, but it is the approach guaranteed to not become a performance dog over time.

3 minutes ago, Wim Decorte said:

a performance dog

LOL. Auto-correct can be hilarious at times.

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.