January 28, 201510 yr This must be easy to do, but I just can't think it through. Suppose Field#1 contains the value "Yes". Then I want to allow a user to edit "Yes" to "No". But if Field#1 already contains "No", then I want to prevent this being changed to anything else. I'd like to do this with minimal overhead - preferably no Script Triggers or buttons or dialogues - it should be seamless. i.e. if the user overwrites "No" with "Yes", it should revert back to "No" with no dialogue. Is this possible ? Thanks for your time.
January 28, 201510 yr I feel like this is a very common desire, but Filemaker doesn't have an easy way to accomplish this... Is your case simply that one field Yes/No field?? You should just use some script triggers...Store the current field value on field enter To a $$Global Variable or a global field. Then, on field exit, have another script trigger, if Previous Value = "No" and Field1Value = "Yes"; Field1Value = "No". Each script would be a couple of lines. If you wanted you could show a dialog sending a message about reverting the field.
January 28, 201510 yr Which FM version? Your profile says 7 but you mention Script Triggers. What you want is easy in FM13.
January 28, 201510 yr Hi Peter and welcome back. A lot of changes to FileMaker since version 7, please update your profile to reflect your current information. Here is a quick link for you convenience. MY PROFILE
January 28, 201510 yr @hbrendel....could we see your 'easy way'? I tend to overcomplicate things. I came up with this script trigger for OnObjectModify, Script parameter is just the field Set Variable [$$a; Value:Get(ScriptParameter)] If [isEmpty ($$a) or $$a="Yes"] Else Set Field [Table::field;"No"] // Yes/No field End If Set Variable [$$a; ""] I put this on a radio button set. In this field I use RayBaudi's (where's he been?) much posted: GetValue (Self; ValueCount (Self)) as an auto enter calc, "do not replace..." unchecked, to prevent shift+clicking both buttons
January 28, 201510 yr I use 'Hide Object When'. Make two instances of the same field, One is editable, the other not. Give them complementary conditions for hiding and place them on top of each other. The non-enterable field is hidden when the value not = "No". The enterable field is hidden when the value = "No". Easy in FM 13...
January 29, 201510 yr But if Field#1 already contains "No", then I want to prevent this being changed to anything else. I'd like to do this with minimal overhead - preferably no Script Triggers or buttons or dialogues - it should be seamless. i.e. if the user overwrites "No" with "Yes", it should revert back to "No" with no dialogue. I think the question of why you want this should come before the question of implementation costs. If this is a matter of data integrity, then it should be solved at the data layer, not by using any layout measures (script triggers, conditional formatting, etc.). Are you really using version 7 as indicated by your profile?
January 29, 201510 yr Thanks Henk Brendel for your detailed explanation. I still have 12, so I'll have to file it away in my brain.
February 4, 201510 yr This worked perfectly for my case, thank you! Very cool, I hadn't seen Hide Object When.. I use 'Hide Object When'. Make two instances of the same field, One is editable, the other not. Give them complementary conditions for hiding and place them on top of each other. The non-enterable field is hidden when the value not = "No". The enterable field is hidden when the value = "No". Easy in FM 13...
Create an account or sign in to comment