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.

Common scripts in separate file?

Featured Replies

So far, I've split an existing application into 2 layers ...

1) data (more or less one file per table, but as I normalize further, I will break some tables into several tables in the same file) and

2) UI (one per major user function.)

However, I have some common scripts which at the moment are duplicated in each UI. Would it make sense to create a separate file to contain these? (One possibility would be to combine them with the Global data file I created with all of the global fields.)

Patricia--

When you set up multiple UI files, you end up duplicating scripts from one file to the next, as you've found.

Unless you have compelling reasons otherwise (such as you're selling a modular system and expect to have some functions paid for separately), most folks recommend putting ALL your UI functionality (layouts & scripts) in one database file. Then you only have one place with the scripts.

The UI file will have file references to your data files, and table occurences for your various tables. The layouts will be built on these table occurences.

  • Author

I agreed to convert this system from FM6 to FM7. Unfortunately, I haven't found any way to import layouts from one UI file to another. I have been able to import scripts. Is there an import function for layouts? That is part of the reason that I kept separate UI files.

Copy and Paste. Copy a layout in Layout mode, go to other file an paste in in a new layout.

  • Author

Well ... yes .. I found out how to do that ... but it was a painful process so I thought there must be a better way that I was missing. Thanks

You can make the layout moving almost painless by observing the following process:

1. Create value lists as needed, with matching names (source and target files)

2. Create relationships with matching names

3. Create blank layouts with matching names - don't paste yet!

4. Import scripts -

4b. Review scripts, and if any have a number appended to them (e.g. My Script2), go into your source file and rename to match.

5. Copy and paste layouts

If you do this, all your layout fields and buttons should work correctly.

I think you may need to add a 'step'. Step 0. Never delete a field, relationship, value list, or script. wink.gif If you do, you cannot say for sure whether they will all match up correctly in a new file. So check all fields that are formatted as buttons or value lists, or included in scripts. to be sure that none of them have something 'missing' or are using the wrong ones.

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.