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.

Copy Records Script Question

Featured Replies

I would like to copy data from one table to another table.

I have the following tables...

t_Manage_Procedure_List

-----------------------------------

KEY (auto)

Name

Description

t_Manage_Procedure_Items

-----------------------------------

KEY ( = t_Manage_Procedure_List KEY)

Description

t_Manage_Procedure_List = t_Manage_Procedure_Items (allow creation/deletion of records)

t_User_Procedure_List

-----------------------------------

KEY (auto)

Name

Description

t_User_Procedure_Items

-----------------------------------

KEY ( = t_User_Procedure_List KEY)

Description

t_User_Procedure_List = t_User_Procedure_Items (allow creation/deletion of records)

Also, relation t_Manage_Procedure_List = t_User_Procedure_List

In case you're wondering, the relation allows me to show the List and a portal of records (items).

I want to create a script to do the following (psuedocode)...

#1.) Create a new t_User_Procedure_List record.

#2.) Copy t_Manage_Procedure_List's "Name" and "Description" fields to t_User_Procedure_List's.

#3.) Copy all associated items from t_Manage_Procedure_Items (i.e. belonging to t_Manage_Procedure_List = KEY) to t_User_Procedure_Items now associated with the new record created in #1.

Pictorially, here is what would happen...

t_Manage_Procedure_List (shown in "Layout 1")

-----------------------------------

KEY: 1

Name: Procedure 1

Description: Procedure 1 Description

KEY: 33

Name: Procedure 33

Description: Procedure 33 Description

KEY: 123

Name: Procedure 123

Description: Procedure 123 Description

(etc.)

t_Manage_Procedure_Items

-----------------------------------

KEY: 1

Description: Item 1 Description for Procedure 1

KEY: 1

Description: Item 2 Description for Procedure 1

KEY: 1

Description: Item 3 Description for Procedure 1

KEY: 33

Description: Item 1 Description for Procedure 33

KEY: 33

Description: Item 2 Description for Procedure 33

KEY: 123

Description: Item 1 Description for Procedure 123

(etc.)

So, the user clicks on Procedure 1 from Layout 1...now I want to copy all the associated data for Procedure 1 to a new t_User_Procedure_List record and show it in Layout 2, which might end up looking like this...

t_User_Procedure_List (shown in "Layout 2")

-----------------------------------

KEY: 188

Name: Procedure 1

Description: Procedure 1 Description

t_User_Procedure_Items (Shown in portal on "Layout 2")

-----------------------------------

KEY: 188

Description: Item 1 Description for Procedure 1

KEY: 188

Description: Item 2 Description for Procedure 1

KEY: 188

Description: Item 3 Description for Procedure 1

NOTE: I have access to the t_Manage_Procedure_List from "Layout 1". The t_User_Procedure_List would be shown in "Layout 2".

Any idea how one might script this??

Many, many thanks for any ideas or solution for this.

Many regards,

Kevin

  • Author

OK, I actually figured this out. It was a bit obtuse, but I got it.

Kevin

I am trying to do something similar. Can you share your solution?

  • Author

Basically, I have a layout that shows the portal of related records to the master record. I go to that layout, then using the goto first/next on the portal, I loop and concatenate the strings together, separating them with a <CR>. Then I go to the layout with the target portal I want to copy the records over to, create a new record, then using the portal row last, walk the string with the <CR>'s backwards and set the field in the portal to each string. Took some doing and debugging on my part to get it all to work right, but it works like a charm.

Hope that helps.

Kevin

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.