1 Reply Latest reply on Jul 8, 2011 9:18 AM by philmodjunk

    go to another file, in an exact format

    RossanoIennarelli

      Title

      go to another file, in an exact format

      Post

      I'm using fmp 11 and filemaker go on an ipad, I'm making a general home page with some buttons, each buttons open a different database, one of the databases has multiple formats for multiple users. The choise of the format is made by control on username, but this control must be delete.

      How can i make a script that open a file in an exact format?

        • 1. Re: go to another file, in an exact format
          philmodjunk

          "...but this control must be delete."

          How's that again?

          There are several ways a script can use Get ( UserName ) to select the correct layout for that user.

          If [Get ( UserName ) = "Fred" ]
             Go To layout [ //specify the right layout for "Fred"]
          Else If [ Get ( UserName ) = "George"]
          //and so forth

          is a crude, but simple way to do this.

          Better is to set up a user preferences table where you store the user name in one field and use additional fields to store other data that customize your solution's look and feel to the needs of each user. A field in this layout can store the layout name or number and then your script can find this record and use the value in this field to select the appropriate layout. (and set the desired view, find records for this user, etc.)

          If you use a global field to relate your main table to this preferences table like this:

          MainTable::gUserName = Preferences::UserName

          Then your script to select a layout might look like this:

          Set Field [MainTable::gUserName ; Get ( UserName ) ]
          Commit Record
          Go To Layout [Preferences::LayoutName] //Use the "layout name by calculation option here

          This second approach allows you to manage system behavior for your user base without needing to modify your script each time a new user name is added to your system.