Jump to content
Server Maintenance This Week. ×

Common scripts in separate file?


This topic is 6875 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6875 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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