Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How to Replace a Layout without disrupting scripts?


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

Recommended Posts

Posted

Hello all. I would like to know the best way to replace/update a layout without causing problems (as I recently did!)

Recently I needed to work on a layout (add a few fields to the layout, shift some things around). I created a duplicate of an existing layout, named "Existing Layout Copy", and made my changes to my copy of the layout (while the dbase was hosted).

Then when all users were out of the dbase (but it was still hosted), I changed the name of my layout to match the existing layout (since 8 allows layouts with identical names), then IMMEDIATELY added the word "OLD" to the previous layout. I also moved my new layout to the same position in the layout listing, and moved the "OLD" layout to the bottom of the list.

Since I am not familiar with all the scripting/calculations in the database (mostly created by someone else), and because I am secretly quite lazy, I was hoping this would circumvent the need to fix lots of scripts. Well it didn't work; I still had scripts saying Unknown Layout... some of which were discovered by unhappy users... I could also swear that I fixed some of those scripts only to have them revert to "Unknown Layout" again, so I hope I didn't introduce some corruption by momentarily having two layouts with the same name.

For future reference, is there any way to replace one layout with another, without this disruption? I am using 8 Advanced, users have regular 8, files were converted from FM 5.5 months ago and appear to be healthy (with one table per file).

Posted

Hi Wendy

Next time you could make the amends to your copy layout and then once you are happy with it and you have no users online you could select all the elements in the new layout, copy them, then go to the old layout, select all elements, delete them and then paste all the new elements into the old layout.

That way you will not have to change any scripts at all

HTH

Phil

Posted

I did think of that (after my initial mess-up, of course), but it seemed clunky, so thought I'd ask if there was another method. Sounds like the copy/paste is the way to go.

Thank you!

(P.S. Like your quote. If only I knew how to start my LIFE over again. Or at least since my college years...!)

Posted

Scripts generally keep track of layouts by their internal IDs. The only times the position or name are important is when using Go to Layout[] by name or by number, or when importing scripts from another file (they match by layout name).

Unless you know all the scripts and buttons that call your layout, it's best to use Phil's advice and copy & paste the changes back into the original layout. This way you don't need to worry about the internal IDs or the name or number references.

This topic is 6446 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.