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.

Create New Related Record Script Step??

Featured Replies

Hi All, I am trying to migrate a 260 field ONE FILE DB to a newly designed db with many related files. I want to write a script to migrate the data and create the appropriate related records. THE EASIEST way would be to use a script step that created portal records. But it seems to me like i need to run an external script for each related file which sucks big time. Am i missing something? Can i create portal records from a parent file script?? I am trying to avoid using multiple globals and external scripts for every single related record. Basically i want to create new Portal record, set portal fields.. from the parent..

rw

I usually use the following technique to create related records.

In the parent database I have a constant field which is defined as a calculation set simply to 1. I usually call this gConstant.

I the child database I have a number field called TempRelationship.

From the parent file I create a relationship to the child file using gConstant as the local match field and TempRelationship as the foreign match field. Make sure that the "Allow creation of related records" is checked in the relationship dialog box.

A script like the following will then allow me to create a record in the child database.

# Create the related record.

Set Field [ Child_gConstant_TempRelationship::Field1, LocalField1 ]

# Set other fields for the related record.

Set Field [ Child_gConstant_TempRelationship::Field2, LocalField2 ]

Set Field [ Child_gConstant_TempRelationship::Field3, LocalField3 ]

# Break the temporary relationship so that a new record can later be created.

Set Field [ Child_gConstant_TempRelationship::TempRelationship, "" ]

This script will create a new record in the child database and set the Field1 field there to whatever value LocalField1 contains. It will create the record because TempRelationship is empty when the script begins. That first step not only create the record and sets the value of the Field1 field, but also sets the value of the TempRelationship field to 1 (so that the relationship will be valid). Other fields are then set, and finally the relationship is broken by clearing out the value in TempRelationship so that the next time a field is set through that relationship a record will be created.

Chuck

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.