1 Reply Latest reply on Dec 7, 2014 1:34 PM by philmodjunk

    Laying out Layout Objects using a script?

    cruiseqe2

      Title

      Laying out Layout Objects using a script?

      Post

      Hi

      I am using FMPA13.

      I have a layout with many input/output fields on.

      I have turned off Save Record Changes Automatically as I wish to handle these actions with my own Accept and Cancel buttons.

      Now, when a user clicks outside a field, FM will bring up its own box asking the user what he wants to do. I have read that in order to prevent this, I should cover the whole layout with an invisible button that does nothing. This button must be placed at the Front.

      As I am still in the design phase, I quite often forget to use Arrange -> Bring to Front before exiting from Layout Mode.

      I was wondering if there was some way that I could ensure that whenever I ran my solution, the first thing it did was to get hold of this (named) button and automatically bring it to the Front.

      Thanking you in advance.

      Mark.

        • 1. Re: Laying out Layout Objects using a script?
          philmodjunk

          FileMaker Scripts can't be used to automate the design of a layout.

          I would think that you'd need this button (an empty web viewer can also be used) in the BACK not the front or you won't be able to click on anything in the layout. Only way to make this quicker would be to set up a blank layout with this button and then use Duplicate Layout to create new layouts. You'd have to select the correct table occurrence context from Layout Setup | Show Records from before adding fields for each new layout if it's not to be based on the same TO as the one that you copied.

          An alternative approach is to set up your data entry form with global fields for data entry. Then clicking save performs a script that "saves" the data by transferring the data from the global fields to corresponding non global fields. These can be fields from an existing record if you are updating a record and the script can first create a new record when you are creating a new record. With this design, you can leave auto-save enabled and clicking anywhere in the layout will not save data nor ask permission to do so.