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.

Import multiple tables in single script

Featured Replies

I'm writing a script to populate five tables in my database by importing from five data sources, taking care to set each Primary Key's next serial number. Here's the procedure:


Go to Layout ["All Invoice fields" (Invoices)]

Import Records [No dialog ; "Invoices.fp7" ; Add ; Mac Roman ]

Sort Records [Restore; No dialog]  /* sort asc. on primary key */

Go to Record [ Last ]

SetNextSerialValue [ Invoices::Invoice_ID ; SerialIncrement ( Invoices::Invoice_ID ; 1 ) ]





For the LineItems table I expected to be able to write





Go to Layout ["All LineItem fields" (LineItems)]

Import Records [No dialog ; "LineItems.fp7" ; Add ; Mac Roman ]

Sort Records [Restore; No dialog]  /* sort asc. on primary key */

But in Sort Records, Scriptmaker doesn't list "All LineItem fields" as being related to the "current table", Invoices.

Why does Sort Records think the current table is Invoices? I don't want to be working through a relationship, I want to be sorting the entire LineItems table, directly.

I have the feeling I'm unclear on some important concept. Is a script somehow "pinned to" one table, (this "current table"), and is it limited to accessing only data that's related to the current table? And if so, must one use five separate scripts to Import to five tables?

Edited by Guest
formatting

ScriptMaker considers the "current table" to be the table for whatever layout happens to be in the foreground when you open ScriptMaker. It doesn't try to change the "current table" based on what the layout gets changed to in the preceeding steps.

If the "LineItems" TO is unrelated to your Invoices table, try switching to a layout based on LineItems before going into ScriptMaker to set the Sort.

  • Author

I see -- so, for Importing, it doesn't matter what layout I use, only the table upon which the layout is based.

Thanks!

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.