Jump to content

Script step to prevent field editing


Mushi

This topic is 6491 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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. :P

Thank you

Edited by Guest
Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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 by Guest
added workaround
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6491 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.