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.

GTRR issue

Featured Replies

I have a table Entries, with fields like Title, Body, etc ... and a table Constraints, with Title.length , Body.length, and so on. I want to have a script check the entry records against the lengths specified in the constraints table, and lt the user make adjustments. The necessary relationships are present.

The script I worte looks like this:

Go to Related Record [ Show only related records; "Entries" ; Using Layout "Entries.by.Body" (Entries) ]

Set Error Capture [ On ]

Go to Record [ First ]

If [ Get ( LastError ) ]

  Halt Script

  # because there are no entries to check

End If

Loop

  If [ Length ( Entries::Body ) <= Constraints::Body.length ]

    Omit Record

  End If

  Go to Record [ Next ]

  Exit Loop if [ Get ( LastError ) ]

End Loop

Go to Record [ First ]

If [ not Get ( LastError ) ]

  Pause Script [ Indefinitely ]

  # Let the user change the records with too long of a body

End If

Show All Records

Go to Layout [ original layout ]

...

I've one script housing snippets like this one, for each field in the Entries table. So the lines immediately after this one are almost exactly the same, but use different fields (eg, title and title.length).

The snippets work: they omit all but the records with an exceeding body length. But if there is no match, a record still remains.

I don't see what I'm doing wrong!?

The omit record step already puts you on the next record. After the first if in the loop, you go to the next record. So if there was a match, it omits the match and is already on the next record. Then you go to the next record so you skipped one (did not check it).

It should be something like:

Loop

If [ Length ( Entries::Body ) <= Constraints::Body.length ]

Omit Record

Else

Go to Record [ Next ]

End If

Exit Loop if [ Get ( LastError ) ]

End Loop

Side note: don't use "." in your field names, layoutnames or tablenames. If you ever need web access or xDBC access to your files you'll be in trouble. In a SQL query the "." is the delimiter between a table name and a field name.

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.