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.

Copying records from one table to another

Featured Replies

I am writing a solution where I want to post information from some records in one table to another table. An example is:

I have a work order that I want to post to a General Ledger. In the GL I need to add new records from a sort in the work order table. I am having trouble getting it right. Do I create the script from the Work order table or from the GL table? Do I need multiple scripts (one finding records and the other adding new records) It feels like It should be easy but I'm not getting it. Can anyone point me in the right direction?

Cindy

Set up a relationship from a global field in the GL table to the id in the Work Order table and a relationship from a WorkOrderID field in the GL table to the id in the Work Order table. Start your script on a layout associated with the Work Order table. Set the global field in the GL table with the first record's id. Commit the change. Move to a layout for your GL table, create a new record, and set the new record's fields with data using the relationship. Go back to the Work Order layout, move to the next record, and repeat for the remaining records. In semi-pseudocode,

Go to Layout [Work Order]

{find desired records}

Loop

Set Field [GL::globalid; id]

Commit Records/Requests

Go to Layout [GL]

New Record/Request

Set Field [WorkOrderid; globalid]

Commit Records/Requests

Set Field [data1; Work Order::data1]

Set Field [data2; Work Order::data2]

...

Go to Layout [Work Order]

Go to Record/Request/Page [Exit after last; Next]

End Loop

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.