5 Replies Latest reply on Jan 8, 2014 1:48 PM by wendy

    Replace a layout with a new version?

    wendy

      Hi everyone. I've done a fair amount of searching on this and found information on layout names, numbers, and internal IDs. What I can't seem to do--and it's making me feel quite stupid--is put it all together and get a solid answer to this question:

       

      I have a layout named MyLayout in Table1.

      I duplicate this layout, name the new one MyLayoutRevised, and make changes to the positions of various fields/elements.

       

      Can I now safely (assuming there are no users logged into my served database):

      - Rename the existing MyLayout to MyLayoutOld

      - Rename MyLayoutRevised to to MyLayout

      ...and have everything work as it always has?

       

      -That is, will scripts with steps such as "Go to Layout ["MyLayout" (Table1)]" still work? Or are these steps using the INTERNAL Layout ID numbers, and my new layout (MyLayoutRevised) will have a different Layout ID number--and therefore script and other references to "MyLayout" will break?

       

      - What about button objects using "Go to Layout" ...?

       

      Any other considerations?

       

      THANK YOU!

        • 1. Re: Replace a layout with a new version?
          DavidZakary

          As soon as you change the layout name, all of the scripts and buttons that use Go to Layout and have a definite layout selected will change. If you use the Layout Name by Calculation option - those don't change.

           

          It is probably easier to make two copies of the original layout, modify one of them and then copy and paste the elements on the layout onto the original, replacing them. I suggest making two copies so that you have one as a working copy and another as a backup. You'd be able to delete the "working copy" once you're done with the modifications.

          • 2. Re: Replace a layout with a new version?
            wendy

            OK, so the moment I change the name of the old layout to "MyLayoutOld", the references would be broken, even though the final result would NOT be a name change--that is, I WOULD have a new layout with the "MyLayout" name...

             

            Right?

            • 3. Re: Replace a layout with a new version?
              Mike_Mitchell

              You can change layout names all day long, and your scripts will continue to point to the original layout. The various script steps and calculation elements work based on the internal ID. It will not break any references to the old layout, and it will not cause your scripts to redirect to a new layout that's named the same as the old one.

               

              The only exception, as David mentioned, is anything that causes the layout name to be calculated via a calculation dialog where you use a text calculation to have FileMaker parse out the name explicitly.

               

              Mike

              • 4. Re: Replace a layout with a new version?
                BruceRobertson

                The scripts and buttons use the internal ID.

                 

                So no. If you change the layout name, and you are just using the basic Go to Layout script step, NOTHING changes.

                You land on the same (old) layout that now has a different name.

                 

                If your scripts (or buttons) use go to Layout Name by Calculation then you will land on the new layout.

                • 5. Re: Replace a layout with a new version?
                  wendy

                  OK, I believe I've got it. DavidZakary, I think I misread your reply--my apologies.

                   

                  So when I change a layout name, the scripts (using the Go To Layout step) that point to it will "change" to the new layout name. That is, they'd be pointing to "MyLayoutOld", because FM is looking at the internal ID--let's say #5.  Same for the buttons using "Go To Layout".

                   

                  To get them to redirect to my new layout--now named "MyLayout", but the name is irrelevant because FM sees this as Internal ID #150--I'd have to find all those references/steps and manually "repoint" them.

                   

                  I like the idea of cutting and pasting into my existing layout!

                   

                  I have been reading with interest the concept of using calculations--and script parameters--for navigation. Unfortunately we have a legacy database built with much older versions of FM that uses a lot of the Go To script steps, so we're a long way from ideal.

                   

                  THANKS EVERYONE!