Jump to content

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

Recommended Posts

Posted

Hey,

I have two fields, one that you enter a dollar amount, and one that categorizes it. I want to make it so if you choose "zero" or whatever from the drop down list of categoriies, then it automatically places the amount "$0.00" in the dollar amount field (and locks you out).... and if you choose something else you can place a new dollar amount... how do I do this?

Thanks

Posted

There is an event plug-in (free) that would let you run a

script as you exit the category drop down...

You could run a sript that freezes the window,

sets the amount field to $0.00 and switches layout to an identical

layout, but in this one select field behavior & uncheck

the access to the amount field.

Dan

Posted

There are several ways to handle this, including validation and Extended Privileges. You have FM7 and a plugin isn't necessary here at all.

The simplest way is this: Set your Amount field to Auto-enter calculation of: If(Category = "Zero"; 0; Amount). Be SURE to unclick the box (auto-enter tab) under calculated value 'Do not replace existing values.'

In this way, if a User selects Zero from popup, the amount will display 0. Users can change it if they wish BUT ... it won't matter because it will immediately change back to 0 as soon as they leave the field. If your popup displays anything else, the amount can be changed and will stay changed -- until they again change the popup to zero.

I think this is friendlier than using validation or extended privileges because it eliminates that unsettling FM error message. I prefer to simply fix it for them.

Posted

It depends upon what you wish to accomplish. A few examples, expanding on the original of If(Category = "Zero"; 0; Amount):)

If(Category = "Zero" or DifferentText = "Yes"; 0; Amount)

If(Category = "Zero" or not IsEmpty(DifferentText); 0; Amount)

If(Category = "Zero" and DifferentNumField < 3; 0; Amount)

If this doesn't do it for you, let us know the specifics and we'll give you the calc. If you want your Amount field to contain more than two possible results, you'll have to switch to a Case() or Choose() calculation.

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