Mark Reed Posted August 3, 2010 Posted August 3, 2010 I have a table called config. In it, I am storing a username, address, phone, email, ect... of info that I want to use in printed forms and other sections of the app. So I made this table and setup global fields. I added a field for last modified - and since globals only store and do not update, I kept it set as a normal field - not a global. I have a layout showing this info, however when I edit any fields, it does not trigger the last mod stamp field to update or change. Is there something I am missing ...? Shouldnt a non global field set for last modified get updated when any of the fields in this record change?
comment Posted August 3, 2010 Posted August 3, 2010 Shouldnt a non global field set for last modified get updated when any of the fields in this record change? Yes - but a global field is not a field in this (or any) record.
Mark Reed Posted August 3, 2010 Author Posted August 3, 2010 how would you approach having these global fields and having a last modified stamp for when they were last changed? For example: A layout for all the global fields that define a business information record - the business name, address, ect... all global and used across the app... Yet you want a stamp on that layout saying when it was last modified.
comment Posted August 3, 2010 Posted August 3, 2010 I'd probably not use global fields for this - certainly not if the solution is shared. But you could set a global field to auto-enter a calculation (replacing existing value), e.g.= Let ( trigger = gName & gAddress & gPhone // etc. ; Get ( CurrentTimestamp ) )
bruceR Posted August 4, 2010 Posted August 4, 2010 You are describing what is often called a Resource table; which does *not* use global fields. It is used to store common values used by a system. It is a single record table, with standard num, text, date, etc fields. Your scripts and privileges enforce it as a single record, not allowing other records to be created. Often it is useful to populate similar-named global fields in the same table, with the startup script or after the standard fields have been updated.
Mark Reed Posted August 4, 2010 Author Posted August 4, 2010 You are describing what is often called a Resource table; which does *not* use global fields. It is used to store common values used by a system. It is a single record table, with standard num, text, date, etc fields. Your scripts and privileges enforce it as a single record, not allowing other records to be created. Often it is useful to populate similar-named global fields in the same table, with the startup script or after the standard fields have been updated. Does anyone know of an example or demo file I can download to see this approach? Also - what is the drawbacks of using a table of globals to define these various parameters that will be used across the db? The goal is to have a screen where the information that will be used all over can be entered and stored. Closest example is somthing like: Company Name Address Phone Email Address Container with company logo ect.. these would be used in various forms and reports I love ripping apart demos, so if anyone has something that does this, I would love to get a copy and see your approach. thanks!
Mark Reed Posted August 16, 2010 Author Posted August 16, 2010 I am having a tough time in grasping how to approach this vs. using the globals. Does anyone have a sample or demo fp7 where I can see how you approach storing and using these fields?
Mark Reed Posted August 16, 2010 Author Posted August 16, 2010 been playing with this and digging into FM Starting Point code... rather than using globals, create a preferences table and link to the single record in that table by creating a constant key field in other tables using a calc. For example: prefs table has a record with a key of 1 for the first record, key of 2 for the second ect.. (although there should only be ONE record... I'll work on that later) So figuring that the first record is the one we want... its key is 1 One every table I want to use that into with, I create a calc that sets the value to 1 for every record... and I link that field to the prefs table is that better than using globals?
Recommended Posts
This topic is 5554 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now