Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

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

Thank you

Edited by Guest
Posted

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"

Posted

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.

Posted (edited)

Thanks for the suggestions

i think that might work... what invisibility trick?! :shocked:

Edited by Guest
Posted

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!

Posted

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:

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted (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 by Guest
added workaround
Posted

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.

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