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.

How to create multiple related records?

Featured Replies

I would like to be able to create multiple new related records (letters) based upon a found set in (dwellings) using key field (license #.)

I know how to do this one at a time with scripting (create new record and copy/paste the key field) - can this be done with many records at a time? Not sure how to get the right number of records created, and how to insert the key fields....

Any help - MUCH appreciated!

Import?

  • Author

As in... export the found set, create new records, import the found set data?

No, as in create a found set in the source table (dwellings?), go to a layout of the target table (letters?) and import directly from the source table.

Copy/paste should pretty much always be avoided. There are several ways to gather a list into a variable and then process the list.

Set variable [ $list; "A¶B¶C¶D"]

Set variable [ $n; valueCount( $list}]

Set variable [$k; 1]

Loop

Exit loop if ($k > $n)

New record

Set somefield; getValue( $list; $k)

Set variable [ $k; $k + 1]

End loop

  • Author

Ok - I think I see how the variable and loop works.

I'm not quite following the first portion of this script:

Set variable [ $list; "A¶B¶C¶D"]

Do I have to establish a repitition number for the variable? (this will vary, and could be in the 200-300 range at times)

{EDIT: it looks to me like Get(FoundCount) would work here - am I on the right track??}

{EDIT#2: so found count can get me the number of items in the found list. The loop can then create a new record, and set the key field to the next value in the list... How do I get the individual license numbers into my variable "list"?

Edited by Guest
still learning!

No, you do not need to use a repetition number. The example variable just shows how a variable can contain a list. You will have to use a loop to walk the records and collect the list of values.

Set variable [ $list; "" ]

Go to record [ first ]

Loop

Set variable [ $list; list ( $list; your::field) ]

Go to next record, exit after last

End loop

  • Author

No, you do not need to use a repetition number. The example variable just shows how a variable can contain a list. You will have to use a loop to walk the records and collect the list of values.

Set variable [ $list; "" ]

Go to record [ first ]

Loop

Set variable [ $list; list ( $list; your::field) ]

Go to next record, exit after last

End loop

Thanks - this makes more sense, especially after studying the LIST function and realizing it does not work across a found set, but on a record and related records.

Regarding the loop above - can I really use "exit after last record" - or was this more of a shorthand way of saying write the script to advance one and compare, then leave when k>n?:(

Edited by Guest
clarification

  • Author

Disregard - found the Next(exit after last) script step!

Thanks - this makes more sense, especially after studying the LIST function and realizing it does not work across a found set, but on a record and related records.

Regarding the loop above - can I really use "exit after last record" - or was this more of a shorthand way of saying write the script to advance one and compare, then leave when k>n?:(

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.