Mushi Posted June 20, 2006 Posted June 20, 2006 (edited) I just have one quick question... Is there anyway to change whether a field can be edited or not through a script step? Here's the situation: I have 1 field with radio buttons Yes/No. If that field is yes, then i don't want the user to be able to enter anything in my second field. If that is no, then i do want my user to be able to enter information in the second field. Thank you Edited June 20, 2006 by Guest
Genx Posted June 20, 2006 Posted June 20, 2006 You could use the filemaker validation to check if the value is no: Go into define database, choose your second field, click options, go to the validation tab, choose validated by calculation and in there put in FirstField = "No"
Raybaudi Posted June 20, 2006 Posted June 20, 2006 I think that Genx wished to say: FirstField = "Yes" BTW if you don't like the FM message with "OK", "No" and "revert", you can set the option of autoenter a calc: Case( FirstField = "Yes"; secondField; "" ) There is even a better way: the invisibility trick.
Mushi Posted June 20, 2006 Author Posted June 20, 2006 (edited) Thanks for the suggestions i think that might work... what invisibility trick?! :shocked: Edited June 20, 2006 by Guest
Mushi Posted June 20, 2006 Author Posted June 20, 2006 The Case statement in the auto enter value worked. I had tried something like that earlier with an If statement, but i think my syntax was wrong. anyways, thank you both!
Inky Phil Posted June 20, 2006 Posted June 20, 2006 See attached sample re invisibilty trick. Change field 1 to yes and no to see result HTH Phil visibility.zip
Inky Phil Posted June 20, 2006 Posted June 20, 2006 Sorry Daniele If my post seems to trample across yours in an abrupt manner I didn't mean to be rude. I was putting together the sample and didn't see that you had already replied Phil :idot:
Genx Posted June 20, 2006 Posted June 20, 2006 Well, i meant no because they wanted to be able to enter a value in the second field if the value in the first field was no... i.e. the value was valid in the second field if the first field was no not yes.
Raybaudi Posted June 20, 2006 Posted June 20, 2006 have I misreaded the post ? or Mushi edited it ? Now you are right !
Genx Posted June 20, 2006 Posted June 20, 2006 ... no it said that before, i had to re-read it the first time i saw it aswell seeing as things like this are usually validated as yes.
winklestork Posted June 20, 2006 Posted June 20, 2006 Interesting. Can this be extended to allow/disallow editing various fields based on a status value? E.g. If a record has a status of "a" you can edit any field, if it has a status of "b" you can edit a subset of the fields, if the status="c" you can edit a different subset, if the status="d" you can not edit any of the fields, ... (What I want is script control over field behavior.)
Genx Posted June 20, 2006 Posted June 20, 2006 Yes but it has to be done in each subset. If you want script control then have a look at EventScript but you still have to enable in each individual field.
Razumovsky Posted June 20, 2006 Posted June 20, 2006 (edited) BTW if you don't like the FM message with "OK", "No" and "revert", you can set the option of autoenter a calc: Case( FirstField = "Yes"; secondField; "" ) Keep in mind that this technique does not actually prevent the field from being edited, rather, it prevents the field from holding any data when the condition is not met. So, if you were to use this with a status field that toggled between "edit" and "hold", whenever "hold" was selected, the contents of the field would be wiped out. You would need a third 'storage' autoenter field to use this technique for just editing: Storage: Case( FirstField <> "Edit"; secondField; Storage ) SecondField: Case( FirstField = "Edit"; secondField; Storage ) Edited June 20, 2006 by Guest added workaround
Genx Posted June 20, 2006 Posted June 20, 2006 Plus, i can almost guarrantee you that if you do it this way you will get phone calls from your users asking "why is my data being wiped" "your database is broken" or my favourite "i've spent the past hour putting data in a field over and over again and it keeps wiping it" ... not that i actually get these comments, but trust me, if you wipe their data, you will, much better to tell them why its occuring using validation rather than wiping whatever they put in the field.
Recommended Posts
This topic is 6730 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