Jump to content

Permit data entry dependent on another field?

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

Recommended Posts

I've been looking for how to do this for a while but cant seem to find the way to manage it.

The problem is that I have two fields that dictate if a charge is allowed to apply and if so how much that charge will be.

Field A has 3 values set by a valuelist

1.Not Allowed



Field B is for entering a value for the charge.

If Field A=Not Allowed or Free then the user should not be able to enter B (it should be "greyed out"). Only if Field A=Allowed should Field B be enabled for use.

I am looking for a way to have Field B "greyed out" as unavailable unless the user selects "Allowed" in field A

Is there a way to do this?

Link to comment
Share on other sites

You could set Field B to validate as a result of calculation. If done properly, when they tried to enter into B with option 1 or 2 selected (or no options selected), then an error box will pop up filled with your custom text, "You cannnot enter a value unless you have selected the "Allow" option." You could make the validation strict, forcing them to empty the field of what they just typed before proceeding.

This isn't as elegant as a "greyed out" option, but it will work.

Another possibility is to duplicate your entry layout. On the duplicate version, take Field B off entirely, maybe replace it with a grey box that looks like a field. Change your valuelist Field A layout to radio buttons based on the list. Make three small transparent circles and place one on top of each radio button. Attach a script to each transparent circle.

The script for option one would be to set Field A to option one, then go to the dupe layout. Option 2's script is the same, except for setting Field A to option 2. The script for the third sets Field A, but does not switch layouts.

The effect would be exactly what you need. The user will never notice the layout switch. You could make the version of the layout with the fake greyed out Field B the "real" layout, where the user goes first, and switch to a dupe with a live Field B only if the third button is clicked.

Steve Brown

Link to comment
Share on other sites

I thought about the changing layout option..... but there is one other factor that I didnt mention ... I have 19 of these sets in the same layout (determining at which point and under which conditions an action is allowed and if a charge is levied) and that would cause an immense number of possible layouts depending on which charge they click on and in which order (not all data entry people access all fields in the assigned tab order, some do it by mouse and jump around a bit!

So the separate layout option wouldnt really work for this case. Its kind of frustrating because I see FMP actually uses the process internally for example when setting the users permissions to change their own password...... the options to set number of days and password length are automatically disabled or enabled depending on the selction made!

Thanks for the try... its appreciated:)

Link to comment
Share on other sites

Another option is to use the visibility technique. Create a calculation field of Case( Field A = "allowed"; serial ) and a relationship between the calculation field and your serial field. Put a one-row portal, with no border, scroll bar, or alternating color, on your layout based on this relationship, then put Field B or the related Field B in the portal. The field will neither be viewable nor modifiable unless Field A is "Allowed".

You can get trickier and add Field B again, formatted to not allow entry and with a gray fill color, positioning it one pixel above and to the left of the portal and tweaking its dimensions until it overlaps the original cleanly. This way the field is viewable and greyed out when Field A does not equal "Allowed" and modifiable and not grey when Field A does equal "Allowed".

Link to comment
Share on other sites

I still have a problem with this method..... it works providing that after I enter the data in field A I must click on the background and not in a field before it takes effect.

If I enter "allowed" in Field A and then tab..... I do not go to the portal field it skips to the field after it..... . It only opens when I enter the "allowed in Field A and then click on the body of the form outside of a field.

Similarly when changing the value from "allowed" to "not allowed" or "free" Field B(inside the portal remains visible and allows tabbing into it until I click on the body of the form... when it disappears.

If entering data by keyboard and tabbing then it doesnt work... even thought the taborder is set to include the portal field.

Link to comment
Share on other sites

Ok... I've been playing with this. Using eventscript plugin to solve the commit record issueI have it working on a single two field basis

i.e. if A=allowed then Bshows and if A =any other value B is hidden (using Queue's visibility method)

But as i mentioned earlier I have 19 sets of these paired fields in the layout (first field stating if a charge is applicable and if that is the case the second field states the amount to charge). It seems that either all the second 19 are shown or hidden dependent on the first one... I am trying to make them independent of each other i.e if A=allowed, C= not allowed, E=allowed then fields B and F should show and Field D should be hidden....

I have tried playing around with relationships but I cant get that to work.... if I use fields from a second occurence of the table it means the calc result is unstored and the visibitity trick seems to fail

It is a lot nearer than I was earlier, but not quite there... any more suggestions to fix the final problem would be more than welcome:)

Link to comment
Share on other sites

This topic is 6640 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.