2 Replies Latest reply on Oct 15, 2016 9:15 AM by philmodjunk

    User Settings across DB

    ericjlindholm

      My users have LOTS of preferences set in a "user" table.

       

      I needs to access those preferences across a large and complex DB.

       

      right now i am using Global variables but there are a lot of them and the user has so reopen the DB for them to get reset.  I could obviously program them to reset when they are edited but that is a huge pain.

       


      I was considering using a global field set with their user ID but it would have be linked and a global field set is every table on DB open.

       

      any ideas for accessing fields from a user record across the DB efficiently?

        • 1. Re: User Settings across DB
          wimdecorte

          Why not just use ExecuteSQL() to read the proper pref when you need it?  You could even make it a CF to make it nicely abstracted.

          That way you don't need global variables, nor do you need to reload global fields.  You just read the pref when you need it.

           

          pref 2016-10-15_12-08-46.png

          1 of 1 people found this helpful
          • 2. Re: User Settings across DB
            philmodjunk

            Whether you use fields with global storage or global fields variables, the result is much the same. The values are accessible from any layout context within the field where they are created. A relationship can make global fields, but not variables accessible in a different file if you set up the needed external data source reference.

             

            The alternative to using globals would be to set up a relationship to occurrences of your preferences table wherever this is needed. This produces a more complex relationship graph and you have to come up with a way, in each context to access the correct preferences record for each user, but it can be made to work and edits to a preferences record by one user can then be immediately accessible by another.