March 28, 200718 yr 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).
April 2, 200718 yr Author I take it there is no easy way to replace a layout without disrupting scripts. Rats.
April 2, 200718 yr 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
April 2, 200718 yr Author 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...!)
April 2, 200718 yr 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.
April 2, 200718 yr Author Sounds like the safest approach. (Any method that means I "...don't need to worry..." is a good method)! :
Create an account or sign in to comment