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.

Duplicate Records Script

Featured Replies

Can anyone help with a script to generate 10 new records. The records in 2 fields are to be a sequential increase in value by 1 from the previous record but the record in a third field is to be the same for all the new records.

Thanks

  • 1 month later...

SetField(g_n_counter, 10)

SetField(g_n_field1, 1)

SetField(g_n_field2, 1)

SetField(g_t_field1, ""data you want"")

Loop

NewRecordRequest

SetField(field1, g_n_field1)

SetField(field2, g_n_field2)

SetField(field3, g_t_field1)

SetField(g_n_field1, g_n_field1 + 1)

SetField(g_n_field2, g_n_field2 + 1)

SetField(g_n_counter, g_n_counter - 1)

ExitLoopIf(g_n_fcounter = 0)

EndLoop

My shorthand is as follows

g_n_... = global number

g_t_... = global text

Thanks!!

Just what I was looking for aswell....

But how do you get the (g_n_field...) to work??? There is no option in the menu. I assume this is generate new/numeric field.

Thanks in advance.

Adam.

'g_n_' just the naming convention I use. The field should be defined as a Global Number field under your field definitions. You may name the fields whatever suits you best.

beginner question

say you want to use the values stored somewhere else to start off your script. How does one "get" the value of a field in another table, and put it into the global variable to start?

Set up a a constant relationship. In the two files you want to relate together, create a constant key,... define a field as a calculation, = 1, defined as a number. Create the relationship in the file you want to push the information from. In the table where you have the stored data, set the stored value into the related global field. You now have the data at your disposal.

Note that there are several ways to get this info, but this should suffice your needs and shows one way to utilize a constant relationship.

In versions < 7, an invalid relationship (e.g. global to global) can work much faster than a constant to constant one, especially if there are hundreds or thousands of records in the related file, since the constant relationship has to get the ids of all related records first.

In version 7, global fields are accessible without a relationship. You simply Set Field [table::global, table1::field] or Set Field [table::global, value].

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.