![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I often find that I want to make a field available on a layout that the user shouldn't be able to change, but I want them to be able to put the cursor, to select text in the field - e.g. to copy & paste. |
|
A semi related question, how do you test user-priviledges. I, quite frankly, have never gotten really used them beyond basic settings because I've found them a royal pain to test and debug. |
#3
| |||
| |||
|
|
Hi all, I often find that I want to make a field available on a layout that the user shouldn't be able to change, but I want them to be able to put the cursor, to select text in the field - e.g. to copy & paste. This should be trivial, and in fact is in most programming environments... usually you just set a property of the textbox instance to 'read only'. In filemaker, this natural intuitive method doesn't seem to exist. (The closest we have is 'allow entry into the field, or not'.) Filemaker DOES let you do it in any of several backhanded ways, each with its own drawbacks. This can be accomplished a number of ways: a) make the field "prohibit modification" in field defs... works great, but means that you can never make the field directly modifiable on a layout, which can be a pain. b) make the field "read only" in user priviledges... works great, but like a) above, prevents you from making the field modifiable, and now you can't even use scripts to change the value unless they are running in 'all access' in the file the table resides in. c) make the layout "read only" in user privs... works great, but only if none of the fields on the layout are directly modifiable, a serious restriction. d) define a custom calculation on the user privs for the field that makes the field readonly if the current layout is such, and editable otherwise. (or vice versa) (I've never actually tried d) ... in theory it should work, although if you have scripts modifying the field, you'd need to make sure you aren't on one of the restricted layouts when it happens. At any rate, even if it works this is so far removed from the actual textbox I'm trying to control that it feels horridly kludgy.) e) unstored calc = real field. essentially a copy of the field, but as its a calc its unmodifiable. This works great, but clutters up the field defs, especially if you want to do this for a lot of fields. How do others solve this problem? Is there a better solution than the one's I've come up with? One of the really annoying things about this simple problem is that all all the solutions except for c) violate the code/data separation model, as they all require changes to the user privs or field defs in the data file. [and c) is too restrictive to be generally useful]. -------------- A semi related question, how do you test user-priviledges. I, quite frankly, have never gotten really used them beyond basic settings because I've found them a royal pain to test and debug. Whats the best test setup? Networked with a [full-access] box, and a "user" box? I assume priv changes propogate more or less 'instantly' (on par with layout and script updates)? Just looking for some general advice, -Dave |
#4
| |||
| |||
|
|
Howard's suggestion for creating a "copy" button is good. Also it helps prevent mistakes with the copy action (eg missing some characters). For "user priviliges" I expect you will need to set up a user table that has the priviliges in a field. See my earlier post with an example of checking the the current user - an example from FM8 help. Michael Paine 42 wrote: Hi all, I often find that I want to make a field available on a layout that the user shouldn't be able to change, but I want them to be able to put the cursor, to select text in the field - e.g. to copy & paste. This should be trivial, and in fact is in most programming environments... usually you just set a property of the textbox instance to 'read only'. In filemaker, this natural intuitive method doesn't seem to exist. (The closest we have is 'allow entry into the field, or not'.) Filemaker DOES let you do it in any of several backhanded ways, each with its own drawbacks. This can be accomplished a number of ways: a) make the field "prohibit modification" in field defs... works great, but means that you can never make the field directly modifiable on a layout, which can be a pain. b) make the field "read only" in user priviledges... works great, but like a) above, prevents you from making the field modifiable, and now you can't even use scripts to change the value unless they are running in 'all access' in the file the table resides in. c) make the layout "read only" in user privs... works great, but only if none of the fields on the layout are directly modifiable, a serious restriction. d) define a custom calculation on the user privs for the field that makes the field readonly if the current layout is such, and editable otherwise. (or vice versa) (I've never actually tried d) ... in theory it should work, although if you have scripts modifying the field, you'd need to make sure you aren't on one of the restricted layouts when it happens. At any rate, even if it works this is so far removed from the actual textbox I'm trying to control that it feels horridly kludgy.) e) unstored calc = real field. essentially a copy of the field, but as its a calc its unmodifiable. This works great, but clutters up the field defs, especially if you want to do this for a lot of fields. How do others solve this problem? Is there a better solution than the one's I've come up with? One of the really annoying things about this simple problem is that all all the solutions except for c) violate the code/data separation model, as they all require changes to the user privs or field defs in the data file. [and c) is too restrictive to be generally useful]. -------------- A semi related question, how do you test user-priviledges. I, quite frankly, have never gotten really used them beyond basic settings because I've found them a royal pain to test and debug. Whats the best test setup? Networked with a [full-access] box, and a "user" box? I assume priv changes propogate more or less 'instantly' (on par with layout and script updates)? Just looking for some general advice, -Dave |
#5
| |||
| |||
|
|
Create a script and put it on the menu for testing, either to pop up a re-login dialog, or to automatically relogin at a specific level. This makes it very easy to go back and forth between user level for testing and dev level for making adjustments. |

#6
| |||
| |||
|
#7
| |||
| |||
|
|
Now if only FM had had the read-only textbox checkbox i was also hoping for... ![]() |
#8
| |||
| |||
|
|
42 wrote: Now if only FM had had the read-only textbox checkbox i was also hoping for... ![]() OK -- here's another idea -- depends on the situation, but may work for some solutions. Add a global field (number). Set your access privileges for editing so that if the flag is '1', then fields are editable, otherwise not (or the other way around). Use scripts upon opening, switching layouts, certain conditions, etc, to mark the global with a one and fields will be enterable but not editable. |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
I think Howard was referring to putting a validation on the field from within "Define Fields". If the global equals 1 you can edit, if not then the validation fails and you can't modify it. Since you can use the same global for all fields it rather simple to allow / deny access to a set of fields. The pain in the ass is you have to copy and paste the validation for each field AND remember that those fields have a validation on them when you use them in scripts. In record modification privileges if you specify you can not view or modify the record, the user can still see and modify the globals in that table. |
![]() |
| Thread Tools | |
| Display Modes | |
| |