Lewis Howell Posted December 19, 2007 Posted December 19, 2007 I am new to FileMaker, but not new to development or databases (15-20 years). I have books and do extensive research before asking questions, that is if I am not under a time constraint. I appreciate any assistance with the following: I have a report that I have scripted to run. I show a dialog and filter by a date. This is successful. 1. I want to show a dialog and filter by a date range? 2. I want to display the date range back to the user on the report? Thanks for any help, Lewis Howell
CobaltSky Posted December 19, 2007 Posted December 19, 2007 Hi Lewis and welcome to the forum! The dialog you present to users can include fields for them to enter the desired start and stop dates for the report they are requesting. The values entered can be captured into a pair of global fields. You can add the global fields (eg as merge placeholders) within the header area of your report so it will automatically include the date span the user entered. Assuming that by "filter" you mean that your script first performs a find to locate the matching records, you will be able to have the script perform a range find by entering the find criteria as start and end dates with a pair of periods between them. Eg: 12/18/2007..12/22/2007 ...so your script can build the find criteria using the global field values, along the lines of: Enter Find Mode[ ] Set Field [YourDateField; gFrom & ".." & gTo] Perform Find [ ] ...and so on. HTH.
Lewis Howell Posted December 19, 2007 Author Posted December 19, 2007 Thanks. When I say filter, I mean find. This is how I do the find: Enter Find Mode[] Show Custom Dialog[MyDateField] Perform Find[] I was reading about global fields and trying to understand how rthey are handled in FileMaker. I am assuming global fields are in a table. If so, and the database is peer-to-peer, would every user have the same values in the global fields?
CobaltSky Posted December 20, 2007 Posted December 20, 2007 I was reading about global fields and trying to understand how rthey are handled in FileMaker. I am assuming global fields are in a table. If so, and the database is peer-to-peer, would every user have the same values in the global fields? Global fields are indeed defined as part of a table. You simply select the Use Global Storage (one value for all records) checkbox option in the storage panel of the Options for Field dialog. When a database is hosted (including peer-to-peer), each user sees his/her own separate instance of global field values. So the values in global fields when the file is first opened on a client computer are those that were present when the file was last closed on the host computer (or in single-user mode). However changes to global field values made on client workstations are seen only on the workstation where they are made and are discarded when the client file session ends (ie when the user closes the file). What that means in effect is that several users can simultaneously run a process (such as the one we've been discussing here) with different values in the global fields, without tripping over one another. Each client process will operate without reference to the others. :wink2:
Lewis Howell Posted December 20, 2007 Author Posted December 20, 2007 Excellent. I will play with Global Fields without hesitation now. Should I have 1 table for all my gloabal fields, or should each table have a column for any global fields?
CobaltSky Posted December 20, 2007 Posted December 20, 2007 Excellent. I will play with Global Fields without hesitation now. Should I have 1 table for all my gloabal fields, or should each table have a column for any global fields? That depends on how you intend to use them. For the purpose discussed here, a separate table would suffice (and might be a little tidier). FWIW, in cases where you will use global fields as key fields for utility relationships, it can be necessary to locate them in the tables from which the relationships are required. So it's not uncommon to see some globals within data tables as well as in a globals table, according to their purpose.
Recommended Posts
This topic is 6188 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