May 11, 200817 yr I have a "Resources" table which pools all the global fields needed for a solution. I'm migrating to a multi-user server setting. Luckily, most of the globals are initialized and expected to "persist" only for the duration of a login session: they don't have to retain their values across sessions. But there are a few that have to be able to be permanently changed (company logo, most recent batch number, etc.). What I did was -- change all such "persistent" fields to be non-global -- add a global calculation field g_One that's permanently set to 1. -- add a nonglobal calculation field c_One that calculates to 1. -- created a TO based on Resources called PersistentGlobals with the relationship Resources::g_One = PersistentGlobals::c_One. I took care to ensure that there is always exactly one record in the Resources table. For some reason, though, the results are unpredictable -- layouts that should show these persistent global fields (e.g. PersistentGlobals::last_batch_number) show nothing at all. And sometimes they do, although I don't know if that's a result of my diddling around behind the scenes. Am I doing this right? And doesn't it matter that the global field (g_One) be on the left side of the relationship? Something else I'm unclear about is: since g_One a global, it is always related to any layout. And g_One is one-half of the relationship to c_One, which lives on the PersistentGlobal record. Does that mean that fields on the the PersistentGlobal record are also related to any layout? Or should I declare a g_One field in every table from which I need to access PersistentGlobals, and a corresponding relationship? If that makes any sense. Thanks, Chap
May 12, 200817 yr 1. You can use the cartesian 'X' join to a TO for all the places you would need to access this "preferences/persistent" data. 2. You can set a couple of global fields to the values of your persistent data. Now you can use the globals anywhere. 3. You can create global calcs to the value of the persistent data, and then use a field to trigger it. (Read posts on when global calcs recalc). Now you can use the globals anywhere.
May 12, 200817 yr Author All very nice suggestions. You missed one, though: to ensure being able to see the persistent data on a layout, be sure to set the text font to some color besides that of the background. : But seriously, thanks for those ideas. Seems like a Cartesian join would be the easiest.
May 12, 200817 yr I would generally vote for option 2 as easiest to manage. Just set your globals at startup. You'll never need to clutter your graph with extra relationships, because globals can be accessed even from unrelated tables.
Create an account or sign in to comment