Claus Lavendt Posted June 12, 2008 Posted June 12, 2008 Hi Not sure this is the right category... what I want is a checkbox field for each record in a contact table, but it should act like a global field, only for the user, who checks it. The goal is that a user could find a list of records, then mark some of the records and then run a script that e.g. prints the selected only. The problem is, that if it is a standard checkbox, another user could check or uncheck this box, before the first user has been able to run the print script, which makes the wanted set of records unconsistent. Every user has their own interface file local on their computer. The datafile is located on a server. Any suggestion to how this scenario could be accomplised ?
Fitch Posted June 12, 2008 Posted June 12, 2008 The checkbox that actually displays could be a calculated field, something like: FilterValues( checkboxIDs ; userID ) = userID & ¶ Use this calc field as a button, and when a user clicks, it could add or remove his user ID to a text field (checkboxIDs). Note: this won't avoid record locking issues, which I think are unavoidable in this scenario.
comment Posted June 12, 2008 Posted June 12, 2008 I don't see why there would be record locking issues, if the text field is a global.
bcooney Posted June 12, 2008 Posted June 12, 2008 Here's a multi-user friendly demo for marking records. Credit to Matt Petrowsky for the addremove calc. If you want to allow the user to mark records over the course of a few days (quitting FM), then write the global field to a field in the user table, and restore it in an Open Script. MarkRecordsDemo.zip
Fitch Posted June 12, 2008 Posted June 12, 2008 Ah, yes. I was thinking of adding the user ID to a field in each record. I've seen that technique and it was the one that popped into my head. It does make more sense to add record IDs to a global instead.
Derf Posted May 8, 2011 Posted May 8, 2011 Here's a multi-user friendly demo for marking records. Credit to Matt Petrowsky for the addremove calc. 1213301337-MarkRecordsDemo.zip (6K) This is just what I have been looking for. The demo does exactly what I wanted. The problem is mine acted funny. I have 20 records that I want to choose only 4 or less to print at one time in a special form. It seemed to work perfectly but then I was testing it and clicking different checkboxes and suddenly some of the X marks disappeared from some I had already marked. Then others would pop in when I was clicking different records. So I took the demo program MarkRecordsDemo.zip and added a dozen more records and started clicking on different boxes and his does the same thing. That's not going to work very well and there is no way I can figure what is happening. Any help would be very much appreciated. :huh:
Claus Lavendt Posted May 8, 2011 Author Posted May 8, 2011 This is indeed an old post and I have since done many implementations to solve this challange.... My favorite is to have a global text field in my system table (the table in the data file, which hold general data for value lists, defaults etc.). Lets say that we want the checkbox on the customer. Then I add a relationship between customer and the global text field in SYS we call "_CustomerCheckBox_g" and the Customer_PrimaryKey_n. The relation is true if the customer pk is in the global field. I then add a checkbox field to the customer table with this simple calc: If ( IsValid ( Customer::System_Cust_Checkbox ) ; 1 ; "" ) Based on the value in the calc field, you can show a checkbox or graphic or conditional formatting as you please. Don't give access to the field itself, but make it a button, which adds or remove the current Customer_pk from the global field. When user logout, the global field is cleared and it is unique for each user of the system. Check Briandunning.com for a custom function AddOrRemoveValueListItem (or something like that) That function make the implementation of this feature very easy.
Derf Posted May 10, 2011 Posted May 10, 2011 This is indeed an old post and I have since done many implementations to solve this challange.... My favorite is to have a global text field in my system table (the table in the data file, which hold general data for value lists, defaults etc.). Lets say that we want the checkbox on the customer. Then I add a relationship between customer and the global text field in SYS we call "_CustomerCheckBox_g" and the Customer_PrimaryKey_n. The relation is true if the customer pk is in the global field. I then add a checkbox field to the customer table with this simple calc: If ( IsValid ( Customer::System_Cust_Checkbox ) ; 1 ; "" ) Based on the value in the calc field, you can show a checkbox or graphic or conditional formatting as you please. Don't give access to the field itself, but make it a button, which adds or remove the current Customer_pk from the global field. When user logout, the global field is cleared and it is unique for each user of the system. Check Briandunning.com for a custom function AddOrRemoveValueListItem (or something like that) That function make the implementation of this feature very easy. Some how I knew it wasn't going to be just a simple change to what I have. Thanks Claus L, I will see if I can figure this out.
Vaughan Posted May 10, 2011 Posted May 10, 2011 If ( IsValid ( Customer::System_Cust_Checkbox ) ; 1 ; "" ) IsValid is not a good choice of function here. Probably IsEmpty would be better. IsValid is used to identify data mis-match, invalid values (such as 30 Feb in a date field) or missing fields. IsEmpty is used to identify whether a field contains a value.
Claus Lavendt Posted May 10, 2011 Author Posted May 10, 2011 IsValid is not a good choice of function here. Probably IsEmpty would be better. IsValid is used to identify data mis-match, invalid values (such as 30 Feb in a date field) or missing fields. IsEmpty is used to identify whether a field contains a value. Yeah.... my bad.... I don't actually use IsValid, but it just seems easier to explain that way. Sorry for misleading..... So I've created a sample file from FMstarter solution. Look at the checkbox field. There are also 2 custom functions, that makes this very simple.... ....I couldn't see the file, so I try again...... CheckBoxGlobal.fp7.zip
Derf Posted May 11, 2011 Posted May 11, 2011 Yeah.... my bad.... I don't actually use IsValid, but it just seems easier to explain that way. Sorry for misleading..... So I've created a sample file from FMstarter solution. Look at the checkbox field. There are also 2 custom functions, that makes this very simple.... ....I couldn't see the file, so I try again...... Thanks for the help, I will see if I can get it to work with my DB.
imaslowmoose Posted November 8, 2011 Posted November 8, 2011 Here's a multi-user friendly demo for marking records. Credit to Matt Petrowsky for the addremove calc. If you want to allow the user to mark records over the course of a few days (quitting FM), then write the global field to a field in the user table, and restore it in an Open Script. Is there a select all button or a deselect all button sample I could take a look at?
bcooney Posted November 8, 2011 Posted November 8, 2011 Updated demo with Mark All and Clear All. MarkRecordsDemo2.fp7.zip
imaslowmoose Posted November 8, 2011 Posted November 8, 2011 Updated demo with Mark All and Clear All. clear all works great. the mark all how do we write the script so it only marks the records currently being viewed?
bcooney Posted November 9, 2011 Posted November 9, 2011 Take out the Show All records before the loop, and I'd change the button to Mark Found. However, if you have marked some records, then did a find and marked some more, there are potentially records not in the found set that are marked. How do you want to handle that? The Show Marked will establish a found set of all marked.
Matt Malyschko Posted October 9, 2012 Posted October 9, 2012 Here's a multi-user friendly demo for marking records. Credit to Matt Petrowsky for the addremove calc. If you want to allow the user to mark records over the course of a few days (quitting FM), then write the global field to a field in the user table, and restore it in an Open Script. I just came across this post, and this demo is something I've tried to implement in a database before. Can you explain how the toggle works, I understand how to add to a list, but couldn't figure out how to deselect (so I just implemented a clear all). I'd like to be able to individually deselect items however.
bcooney Posted October 9, 2012 Posted October 9, 2012 The toggle is a fancy substitute. If it finds the value in the global, it substitutes it out, otherwise it appends it. Clear All will empty the global. You'll lose all marks.
Recommended Posts
This topic is 4488 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