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.

Find script on repeating field

Featured Replies

Hi,

I'm having a little problem with my script. I have two repeating fields, description and cost. Each field has 10 repetitions.

I want to write a script to do a find on all 10 repeating fields in description that have something written in them and all the cost fields that have nothing in them.

Here is the script I wrote, the problem is that is only does the find on the first repeating field.

[color:blue]Enter Find Mode[]

Insert Calculated Result["Description", "*"]

Insert Calculated Result["Cost", "="]

Perform Find[]

Is there something I'm doing wrong? Please help.

thanks,

Wild.

"Is there something I'm doing wrong?"

Yes - using repeating fields.

"The problem is that is only does the find on the first repeating field."

No, that is not the problem. The problem is that a find performed in a repeating field will always search all repeats. You simply cannot isolate repeats.

Stop using repeating fields and move to a relational desgin. You cannot do what you are trying to do. You can't individually find, delete, sort, do subsummaries, etc.

Wild--

Welcome to the Forums. Bruce is right--the repeating field structure is strongly discouraged for the type of use you're trying to put it.

Basically, what Bruce is recommending is that you take your repeating fields, and separate that information into a separate table, one where each record stores information about a single widget (whatever it is you're trying to describe--you don't really say). The structure for this table will be something like:

table_Widgets:

WidgetID (Auto-enter Serial Number) /* This identifies the specific widget record uniquely */

ParentID (Number) /* This stores the ID number for the record in which you used to have those repeaters */

Description (Required)

Cost (Required)

You will then create a relationship between your original table's ID field, and the ParentID field, thus allowing you to show all the widgets attached to the Parent in a portal. Notice that I set Description and Cost to be required; this will help ensure that your users don't keep skipping those fields!

However, if you are trying to set up an invoicing scheme, you might consider changing things a little. Create a Products table, store the descriptions and unit price there, and then have the widgets table described above store the ProductID and a quantity entry. Your users would no longer be responsible for entering descriptions, since they'd be in the products table. Also, you could set up the Cost field to auto-enter a calculation of Quantity * Products::UnitPrice, eliminating user error there as well...

HTH,

David

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.